Module: Apimaster::Helpers::Request
- Defined in:
- lib/apimaster/helpers/request.rb
Instance Method Summary collapse
-
#hash_to_query_string(hash) ⇒ Object
Convert a hash to a querystring for form population.
- #posts ⇒ Object
- #query_string_modifier(hash) ⇒ Object
Instance Method Details
#hash_to_query_string(hash) ⇒ Object
Convert a hash to a querystring for form population
11 12 13 |
# File 'lib/apimaster/helpers/request.rb', line 11 def hash_to_query_string(hash) hash.collect {|k,v| "#{k}=#{v}"}.join("&") end |
#posts ⇒ Object
19 20 21 |
# File 'lib/apimaster/helpers/request.rb', line 19 def posts @posts ||= to_symbol_key_hash(request_json) end |
#query_string_modifier(hash) ⇒ Object
15 16 17 |
# File 'lib/apimaster/helpers/request.rb', line 15 def query_string_modifier(hash) hash_to_query_string(CGI::parse(request.query_string).merge(hash)) end |