Sha256: 7d94b3d338a97e8778c6210cef18d440a3dd5f279552aeac13e906ec2ede73a5

Contents?: true

Size: 749 Bytes

Versions: 32

Compression:

Stored size: 749 Bytes

Contents

require 'rack/utils'

module Restfully
  module MediaType
    
    class ApplicationXWwwFormUrlencoded < AbstractMediaType
      
      class Parser
        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
        
        def self.dump(object, *args)
          ::Rack::Utils.build_nested_query(object)
        end
      end
      
      set :signature, "application/x-www-form-urlencoded"
      set :parser, Parser
    end
  
    register ApplicationXWwwFormUrlencoded
    
  end
  
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
restfully-1.3.0 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.2.0 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.1.1 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.1.0 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.8 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.7 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.6 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.5 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.4 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.3 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.2 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.1 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.0 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.0.rc2 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-1.0.0.rc1 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-0.8.8 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-0.8.7 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-0.8.6 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-0.8.5 lib/restfully/media_type/application_x_www_form_urlencoded.rb
restfully-0.8.4 lib/restfully/media_type/application_x_www_form_urlencoded.rb