Class: HTTPI::QueryBuilder::Nested
- Inherits:
-
Object
- Object
- HTTPI::QueryBuilder::Nested
- Defined in:
- lib/httpi/query_builder.rb
Class Method Summary collapse
-
.build(query) ⇒ Object
Returns a
query
string given aHash
.
Class Method Details
.build(query) ⇒ Object
Returns a query
string given a Hash
. Example:
build({names => ['Bruno', 'Samantha', 'Alexandre']})
# => "names[]=Bruno&names[]=Samantha&names[]=Alexandre"
24 25 26 27 |
# File 'lib/httpi/query_builder.rb', line 24 def self.build(query) stringfied_query = stringify_hash_values(query) Rack::Utils.build_nested_query(stringfied_query) end |