restpack-core-client 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,9 +20,9 @@ module RestPack
20
20
  hydrate_channel(data)
21
21
  end
22
22
 
23
- def get_domain(identifier)
24
- p "API.get_domain(#{identifier})"
25
- json = RestClient.get("http://:#{@password}@#{@domain}/api/v1/domains/search.json?identifier=#{identifier}")
23
+ def get_domain(host)
24
+ p "API.get_domain(#{host})"
25
+ json = RestClient.get("http://:#{@password}@#{@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
@@ -13,14 +13,14 @@ module RestPack
13
13
  Cache.new(api)
14
14
  end
15
15
 
16
- def get_channel(domain_identifier)
17
- channel_id = get_channel_id(domain_identifier)
16
+ def get_channel(host)
17
+ channel_id = get_channel_id(host)
18
18
 
19
19
  @channels[channel_id] ||= @api.get_channel(channel_id)
20
20
  end
21
21
 
22
- def get_channel_id(domain_identifier)
23
- @channel_ids[domain_identifier] ||= @api.get_domain(domain_identifier)[:channel_id]
22
+ def get_channel_id(host)
23
+ @channel_ids[host] ||= @api.get_domain(host)[:channel_id]
24
24
  end
25
25
 
26
26
  end
@@ -19,8 +19,8 @@ module RestPack::Core::Client
19
19
  @domains.find { |a| a.id == id }
20
20
  end
21
21
 
22
- def get_domain_by_identifier(identifier)
23
- @domains.find { |a| a.identifier == identifier }
22
+ def get_domain_by_host(host)
23
+ @domains.find { |a| a.host == host }
24
24
  end
25
25
 
26
26
  def get_configuration(id)
@@ -1,12 +1,12 @@
1
1
  module RestPack::Core::Client
2
2
  class Domain
3
- attr_accessor :id, :identifier, :channel, :application, :configurations
3
+ attr_accessor :id, :host, :channel, :application, :configurations
4
4
 
5
5
  def initialize(data, channel)
6
6
  @configurations = []
7
7
 
8
8
  @id = data[:id]
9
- @identifier = data[:identifier]
9
+ @host = data[:host]
10
10
 
11
11
  @channel = channel
12
12
  @application = channel.get_application(data[:application_id])
@@ -1,7 +1,7 @@
1
1
  module RestPack
2
2
  module Core
3
3
  module Client
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
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.3
4
+ version: 0.1.4
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-02 00:00:00.000000000 Z
12
+ date: 2013-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client