layer-api 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/layer/resource.rb +6 -1
- data/lib/layer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9314e85db0d672e30d66549b3f08cf7dd55ea637
|
4
|
+
data.tar.gz: 2815efc1f06bf2dac8683d0c22a5a5c301123369
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1db3daa542ff619f5e42fb578a5ac0476e9b90517bb5ca676ff672c9733a6aba89a1b3f9c7408f29c653fb7d593a056b6e067e37fe85bfb68b3be06187291c8
|
7
|
+
data.tar.gz: 0a4048f4265842dff364c17d73b66ce0d6f9dcccce4b6a0f6731ca6be0a4d6b947638d6c68d5f4d7a58f15f97f34d2a823fd9b522b75075e78bba9544560e007
|
data/README.md
CHANGED
@@ -56,6 +56,7 @@ platform = Layer::Platform::Client.new(api_token: "your_api_token", app_id: "you
|
|
56
56
|
# => #<Layer::Platform::Client @api_token="...", @app_id="...">
|
57
57
|
```
|
58
58
|
If you have `ENV['LAYER_API_TOKEN']` and `ENV['LAYER_APP_ID']` environment variables setup, they will be used by default and don't need to be included:
|
59
|
+
|
59
60
|
```ruby
|
60
61
|
platform = Layer::Platform::Client.new
|
61
62
|
# => #<Layer::Platform::Client @api_token="...", @app_id="...">
|
data/lib/layer/resource.rb
CHANGED
@@ -63,7 +63,12 @@ module Layer
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def list(client, url, params = {})
|
66
|
-
|
66
|
+
if params.any?
|
67
|
+
query = params.collect{ |key, value| "#{key}=#{value}" }.join("&")
|
68
|
+
url = "#{url}?#{query}"
|
69
|
+
end
|
70
|
+
|
71
|
+
collection = client.get(url)
|
67
72
|
|
68
73
|
if collection.any?
|
69
74
|
collection.map{ |resource| new(resource, client) }
|
data/lib/layer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: layer-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Kelly
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|