Class: WWW::Mechanize::Chain::ParameterResolver

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

Instance Attribute Summary

Attributes included from Handler

#chain

Instance Method Summary collapse

Instance Method Details

#handle(ctx, params) ⇒ Object



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

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