restpack-core-client 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,14 +7,14 @@ module RestPack
7
7
  module Core
8
8
  module Client
9
9
  class API
10
- def initialize(domain, password)
10
+ def initialize(domain, access_key)
11
11
  @domain = domain
12
- @password = password
12
+ @access_key = access_key
13
13
  end
14
14
 
15
15
  def get_channel(id)
16
16
  p "API.get_channel(#{id})"
17
- json = RestClient.get("http://:#{@password}@#{@domain}/api/v1/channels/#{id}.json")
17
+ json = RestClient.get("http://:#{@access_key}@#{@domain}/api/v1/channels/#{id}.json")
18
18
  data = JSON.parse(json, :symbolize_keys => true)
19
19
 
20
20
  hydrate_channel(data)
@@ -22,7 +22,7 @@ module RestPack
22
22
 
23
23
  def get_domain(host)
24
24
  p "API.get_domain(#{host})"
25
- json = RestClient.get("http://:#{@password}@#{@domain}/api/v1/domains/search.json?host=#{host}")
25
+ json = RestClient.get("http://:#{@access_key}@#{@domain}/api/v1/domains/search.json?host=#{host}")
26
26
  result = JSON.parse(json, :symbolize_keys => true)
27
27
  result[:domains].first
28
28
  end
@@ -12,5 +12,9 @@ module RestPack::Core::Client
12
12
  @channel = channel
13
13
  @channel.applications << self
14
14
  end
15
+
16
+ def get_configuration_by_key(key)
17
+ @configurations.find { |c| c.key == key }
18
+ end
15
19
  end
16
20
  end
@@ -15,5 +15,9 @@ module RestPack::Core::Client
15
15
  @application.configurations << self if @application
16
16
  @domain.configurations << self if @domain
17
17
  end
18
+
19
+ def get_configuration_by_key(key)
20
+ @configurations.find { |c| c.key == key }
21
+ end
18
22
  end
19
23
  end
@@ -1,7 +1,7 @@
1
1
  module RestPack
2
2
  module Core
3
3
  module Client
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restpack-core-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-03 00:00:00.000000000 Z
12
+ date: 2013-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client