Class: Cucumber::Glue::Hook
- Inherits:
-
Object
- Object
- Cucumber::Glue::Hook
- Defined in:
- lib/cucumber/glue/hook.rb
Overview
TODO: Kill pointless wrapper for Before, After and AfterStep hooks with fire
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#tag_expressions ⇒ Object
readonly
Returns the value of attribute tag_expressions.
Instance Method Summary collapse
-
#initialize(registry, tag_expressions, proc) ⇒ Hook
constructor
A new instance of Hook.
- #invoke(pseudo_method, arguments, &block) ⇒ Object
Constructor Details
#initialize(registry, tag_expressions, proc) ⇒ Hook
Returns a new instance of Hook.
10 11 12 13 14 15 16 |
# File 'lib/cucumber/glue/hook.rb', line 10 def initialize(registry, tag_expressions, proc) @registry = registry @tag_expressions = tag_expressions @proc = proc @location = Cucumber::Core::Ast::Location.from_source_location(*@proc.source_location) warn_for_old_style_tag_expressions(tag_expressions) end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
8 9 10 |
# File 'lib/cucumber/glue/hook.rb', line 8 def location @location end |
#tag_expressions ⇒ Object (readonly)
Returns the value of attribute tag_expressions.
8 9 10 |
# File 'lib/cucumber/glue/hook.rb', line 8 def tag_expressions @tag_expressions end |
Instance Method Details
#invoke(pseudo_method, arguments, &block) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/cucumber/glue/hook.rb', line 18 def invoke(pseudo_method, arguments, &block) check_arity = false InvokeInWorld.cucumber_instance_exec_in( @registry.current_world, check_arity, pseudo_method, *[arguments, block].flatten.compact, &@proc ) end |