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,
|
10
|
+
def initialize(domain, access_key)
|
11
11
|
@domain = domain
|
12
|
-
@
|
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://:#{@
|
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://:#{@
|
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
|
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.
|
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-
|
12
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|