Class: Mechanize::Chain::ParameterResolver

Inherits:
Object
  • Object
show all
Includes:
Handler
Defined in:
lib/mechanize/chain/parameter_resolver.rb

Instance Attribute Summary

Attributes included from Handler

#chain

Instance Method Summary collapse

Instance Method Details

#handle(ctx, params) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/mechanize/chain/parameter_resolver.rb', line 6

def handle(ctx, params)
  parameters  = params[:params]
  uri         = params[:uri]
  case params[:verb]
  when :head, :get, :delete, :trace
    if parameters.length > 0
      uri.query ||= ''
      uri.query << '&' if uri.query.length > 0
      uri.query << Util.build_query_string(parameters)
    end
    params[:params] = []
  end
  super
end