yao 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yao/resources/restfully_accessible.rb +7 -7
- data/lib/yao/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 517b6618308b87efa43bf2b5fa2853c83a543f1d
|
4
|
+
data.tar.gz: 2dec246c29252a5a72ca61d8858095e786003465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c0933ab6497b148eccd6d665937b9356e02ace745a14cef84a34a2e9f4479b97dfb4de1abab5313358033f47f9a706019de2c15d2d5e94e395e3268ada1a1c3
|
7
|
+
data.tar.gz: 692dd164884a732865215e318f5e54e7a2eae8c9d6ef7a7c5e2984deaeb7655d163b2f637f492fee619925e49b733c0a4fe4ea6eabcc280739b022b5a038cff7
|
@@ -28,19 +28,19 @@ module Yao::Resources
|
|
28
28
|
end
|
29
29
|
|
30
30
|
# restful methods
|
31
|
-
def list
|
32
|
-
return_resources(GET(resources_name).body[resources_name_in_json])
|
31
|
+
def list(query={})
|
32
|
+
return_resources(GET(resources_name, query).body[resources_name_in_json])
|
33
33
|
end
|
34
34
|
|
35
|
-
def list_detail
|
36
|
-
return_resources(GET([resources_name, "detail"].join("/")).body[resources_name_in_json])
|
35
|
+
def list_detail(query={})
|
36
|
+
return_resources(GET([resources_name, "detail"].join("/"), query).body[resources_name_in_json])
|
37
37
|
end
|
38
38
|
|
39
|
-
def get(id_or_permalink)
|
39
|
+
def get(id_or_permalink, query={})
|
40
40
|
res = if id_or_permalink =~ /^https?:\/\//
|
41
|
-
GET(id_or_permalink)
|
41
|
+
GET(id_or_permalink, query)
|
42
42
|
else
|
43
|
-
GET([resources_name, id_or_permalink].join("/"))
|
43
|
+
GET([resources_name, id_or_permalink].join("/"), query)
|
44
44
|
end
|
45
45
|
return_resource(res.body[resource_name_in_json])
|
46
46
|
end
|
data/lib/yao/version.rb
CHANGED