lib/yao/resources/restfully_accessible.rb in yao-0.2.1 vs lib/yao/resources/restfully_accessible.rb in yao-0.2.2
- old
+ new
@@ -128,12 +128,15 @@
res = DELETE([resources_path, id].join("/"))
res.body
end
private
+ def resource_name_in_json
+ @_resource_name_in_json ||= resource_name.sub(/^os-/, "").tr("-", "_")
+ end
+
def resource_from_json(json)
- @resource_name_in_json ||= resource_name.sub(/^os-/, "").tr("-", "_")
- json[@resource_name_in_json]
+ json[resource_name_in_json]
end
def resources_from_json(json)
@resources_name_in_json ||= resources_name.sub(/^os-/, "").tr("-", "_")
json[@resources_name_in_json]