Class: Restfully::MediaType::ApplicationXWwwFormUrlencoded::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/restfully/media_type/application_x_www_form_urlencoded.rb

Class Method Summary collapse

Class Method Details

.dump(object, *args) ⇒ Object



20
21
22
# File 'lib/restfully/media_type/application_x_www_form_urlencoded.rb', line 20

def self.dump(object, *args)
  ::Rack::Utils.build_nested_query(object)
end

.load(object, *args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/restfully/media_type/application_x_www_form_urlencoded.rb', line 9

def self.load(object, *args)
  if object.respond_to? :to_str
    object = object.to_str
  elsif object.respond_to? :to_io
    object = object.to_io.read
  else
    object = object.read
  end
  ::Rack::Utils.parse_nested_query(object)
end