Class: WWW::Mechanize::Chain

Inherits:
Object
  • Object
show all
Defined in:
lib/www/mechanize/chain.rb,
lib/www/mechanize/chain/auth_headers.rb,
lib/www/mechanize/chain/ssl_resolver.rb,
lib/www/mechanize/chain/uri_resolver.rb,
lib/www/mechanize/chain/custom_headers.rb,
lib/www/mechanize/chain/header_resolver.rb,
lib/www/mechanize/chain/response_reader.rb,
lib/www/mechanize/chain/pre_connect_hook.rb,
lib/www/mechanize/chain/request_resolver.rb,
lib/www/mechanize/chain/parameter_resolver.rb,
lib/www/mechanize/chain/connection_resolver.rb,
lib/www/mechanize/chain/response_body_parser.rb,
lib/www/mechanize/chain/body_decoding_handler.rb,
lib/www/mechanize/chain/response_header_handler.rb

Defined Under Namespace

Classes: AuthHeaders, BodyDecodingHandler, ConnectionResolver, CustomHeaders, HeaderResolver, ParameterResolver, PostConnectHook, PreConnectHook, RequestResolver, ResponseBodyParser, ResponseHeaderHandler, ResponseReader, SSLResolver, URIResolver

Instance Method Summary collapse

Constructor Details

#initialize(list) ⇒ Chain

Returns a new instance of Chain.



19
20
21
22
# File 'lib/www/mechanize/chain.rb', line 19

def initialize(list)
  @list = list
  @list.each { |l| l.chain = self }
end

Instance Method Details

#handle(request) ⇒ Object



24
25
26
# File 'lib/www/mechanize/chain.rb', line 24

def handle(request)
  @list.first.handle(self, request)
end

#pass(obj, request) ⇒ Object



28
29
30
31
# File 'lib/www/mechanize/chain.rb', line 28

def pass(obj, request)
  next_link = @list[@list.index(obj) + 1]
  next_link.handle(self, request) if next_link
end