Module | Merb::Parse |
In: |
lib/merb-core/dispatch/request_parsers.rb
|
NAME_REGEX | = | /Content-Disposition:.* name="?([^\";]*)"?/ni.freeze |
CONTENT_TYPE_REGEX | = | /Content-Type: (.*)\r\n/ni.freeze |
FILENAME_REGEX | = | /Content-Disposition:.* filename="?([^\";]*)"?/ni.freeze |
CRLF | = | "\r\n".freeze |
EOL | = | CRLF |
request<IO>: | The raw request. |
boundary<String>: | The boundary string. |
content_length<Fixnum>: | The length of the content. |
ControllerExceptions::MultiPartParseError: | Failed to parse request. |
Hash: | The parsed request. |
:api: plugin
value<Array, Hash, Dictionary ~to_s>: | The value for the query string. |
prefix<~to_s>: | The prefix to add to the query string keys. |
String: | The query string. |
If the value is a string, the prefix will be used as the key.
params_to_query_string(10, "page") # => "page=10" params_to_query_string({ :page => 10, :word => "ruby" }) # => "page=10&word=ruby" params_to_query_string({ :page => 10, :word => "ruby" }, "search") # => "search[page]=10&search[word]=ruby" params_to_query_string([ "ice-cream", "cake" ], "shopping_list") # => "shopping_list[]=ice-cream&shopping_list[]=cake"
:api: plugin
query_string<String>: | The query string. |
delimiter<String>: | The query string divider. Defaults to "&". |
preserve_order<Boolean>: | Preserve order of args. Defaults to false. |
Mash: | The parsed query string (Dictionary if preserve_order is set). |
Merb::Parse.query("bar=nik&post[body]=heya") # => { :bar => "nik", :post => { :body => "heya" } }
:api: plugin