Sha256: 37dc19f812976ec7d67e56370eb86ce2cc3be4577c3fc9e195bcfef08a1eabed

Contents?: true

Size: 584 Bytes

Versions: 13

Compression:

Stored size: 584 Bytes

Contents

module Praxis
  module Handlers
    class WWWForm
      def initialize
        require 'rack' # superfluous, but might as well be safe
      end

      # Parse a URL-encoded WWW form into structured data.
      def parse(entity)
        ::Rack::Utils.parse_nested_query(entity)
      end

      # Generate a URL-encoded WWW form from structured data. Not implemented since this format
      # is not very useful for a response body.
      def generate(structured_data)
        return nil if structured_data.nil?
        URI.encode_www_form(structured_data)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
praxis-2.0.pre.5 lib/praxis/handlers/www_form.rb
praxis-2.0.pre.4 lib/praxis/handlers/www_form.rb
praxis-2.0.pre.3 lib/praxis/handlers/www_form.rb
praxis-2.0.pre.2 lib/praxis/handlers/www_form.rb
praxis-2.0.pre.1 lib/praxis/handlers/www_form.rb
praxis-0.22.pre.2 lib/praxis/handlers/www_form.rb
praxis-0.22.pre.1 lib/praxis/handlers/www_form.rb
praxis-0.21 lib/praxis/handlers/www_form.rb
praxis-0.20.1 lib/praxis/handlers/www_form.rb
praxis-0.20.0 lib/praxis/handlers/www_form.rb
praxis-0.19.0 lib/praxis/handlers/www_form.rb
praxis-0.18.1 lib/praxis/handlers/www_form.rb
praxis-0.18.0 lib/praxis/handlers/www_form.rb