lib/fanforce/utils.rb in fanforce-0.3.14 vs lib/fanforce/utils.rb in fanforce-0.3.15
- old
+ new
@@ -100,21 +100,21 @@
raise "Argument must be an object, hash, or array; instead it was a #{obj.class}"
end
end
def to_param(obj, namespace=nil)
- if obj.is_a?(Object)
- obj.to_s
- elsif obj.is_a?(Array)
+ if obj.is_a?(Array)
collect { |e| e.to_param }.join '/'
elsif obj.is_a?(Hash)
to_query_string(obj, namespace)
elsif obj.is_a?(NilClass)
obj
elsif obj.is_a?(TrueClass)
obj
elsif obj.is_a?(FalseClass)
obj
+ elsif obj.is_a?(Object)
+ obj.to_s
end
end
def decode_json(str, symbolize_keys=true)
MultiJson.load(str, :symbolize_keys => symbolize_keys)