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