Class: WWW::Mechanize::Chain::PreConnectHook
- Inherits:
-
Object
- Object
- WWW::Mechanize::Chain::PreConnectHook
- Includes:
- Handler
- Defined in:
- lib/www/mechanize/chain/pre_connect_hook.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#hooks ⇒ Object
Returns the value of attribute hooks.
Attributes included from Handler
Instance Method Summary collapse
- #handle(ctx, params) ⇒ Object
-
#initialize ⇒ PreConnectHook
constructor
A new instance of PreConnectHook.
Constructor Details
#initialize ⇒ PreConnectHook
Returns a new instance of PreConnectHook.
8 9 10 |
# File 'lib/www/mechanize/chain/pre_connect_hook.rb', line 8 def initialize @hooks = [] end |
Instance Attribute Details
#hooks ⇒ Object
Returns the value of attribute hooks.
7 8 9 |
# File 'lib/www/mechanize/chain/pre_connect_hook.rb', line 7 def hooks @hooks end |
Instance Method Details
#handle(ctx, params) ⇒ Object
12 13 14 15 |
# File 'lib/www/mechanize/chain/pre_connect_hook.rb', line 12 def handle(ctx, params) @hooks.each { |hook| hook.call(params) } super end |