lib/hyper_resource.rb in hyperresource-0.9.3 vs lib/hyper_resource.rb in hyperresource-0.9.4
- old
+ new
@@ -194,10 +194,10 @@
## Otherwise, try to match against attributes, then objects, then links.
method = method.to_s
if method[-1,1] == '='
- return attributes[method[0..-2]] = args.first if attributes[method[0..-2]]
+ return attributes[method[0..-2]] = args.first if attributes && attributes.has_key?(method[0..-2])
else
return attributes[method] if attributes && attributes.has_key?(method.to_s)
return objects[method] if objects && objects[method]
if links && links[method]
if args.count > 0