lib/yao/resources/restfully_accessible.rb in yao-0.1.0 vs lib/yao/resources/restfully_accessible.rb in yao-0.1.1
- old
+ new
@@ -56,9 +56,18 @@
else
yield blk
end
end
+ def with_resources_path(path, &blk)
+ original = @resources_path
+ @resources_path = path
+ result = yield(blk)
+ @resources_path = original
+
+ result
+ end
+
# restful methods
def list(query={})
json = GET(resources_path, query).body
if @return_single_on_querying && !query.empty?
return_resource(json[resource_name_in_json])