restpack-core-client 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ module RestPack
|
|
15
15
|
def get_channel(id)
|
16
16
|
p "API.get_channel(#{id})"
|
17
17
|
json = RestClient.get("http://:#{@access_key}@#{@domain}/api/v1/channels/#{id}.json")
|
18
|
-
data =
|
18
|
+
data = Yajl::Parser.parse(json, :symbolize_keys => true)
|
19
19
|
|
20
20
|
hydrate_channel(data)
|
21
21
|
end
|
@@ -23,13 +23,13 @@ module RestPack
|
|
23
23
|
def get_domain(host)
|
24
24
|
p "API.get_domain(#{host})"
|
25
25
|
json = RestClient.get("http://:#{@access_key}@#{@domain}/api/v1/domains/search.json?host=#{host}")
|
26
|
-
result =
|
26
|
+
result = Yajl::Parser.parse(json, :symbolize_keys => true)
|
27
27
|
|
28
28
|
raise "host is not configured: #{host}" if result.empty?
|
29
29
|
|
30
30
|
p "result: #{result}"
|
31
|
-
p "found domains: #{result[
|
32
|
-
p "first domain: #{result[
|
31
|
+
p "found domains: #{result['domains']}"
|
32
|
+
p "first domain: #{result['domains'].first}"
|
33
33
|
|
34
34
|
result[:domains].first
|
35
35
|
end
|
data/lib/restpack-core-client.rb
CHANGED