Class: Mechanize::Chain::PreConnectHook

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

Direct Known Subclasses

PostConnectHook

Instance Attribute Summary collapse

Attributes included from Handler

#chain

Instance Method Summary collapse

Constructor Details

#initializePreConnectHook

Returns a new instance of PreConnectHook.



7
8
9
# File 'lib/mechanize/chain/pre_connect_hook.rb', line 7

def initialize
  @hooks = []
end

Instance Attribute Details

#hooksObject

Returns the value of attribute hooks.



6
7
8
# File 'lib/mechanize/chain/pre_connect_hook.rb', line 6

def hooks
  @hooks
end

Instance Method Details

#handle(ctx, params) ⇒ Object



11
12
13
14
# File 'lib/mechanize/chain/pre_connect_hook.rb', line 11

def handle(ctx, params)
  @hooks.each { |hook| hook.call(params) }
  super
end