Class: Hash
Direct Known Subclasses
Instance Method Summary collapse
-
#to_params(namespace = nil) ⇒ Object
Converts a hash into a string suitable for use as a URL query string.
Instance Method Details
#to_params(namespace = nil) ⇒ Object
Converts a hash into a string suitable for use as a URL query string. An optional namespace
can be passed to enclose the param names. Taken from ActiveSupport
21 22 23 24 25 |
# File 'lib/restfully/extensions.rb', line 21 def to_params(namespace = nil) collect do |key, value| value.to_query(namespace ? "#{namespace}[#{key}]" : key) end * '&' end |