Class: Cucumber::RbSupport::RbHook
- Defined in:
- lib/cucumber/rb_support/rb_hook.rb
Overview
Wrapper for Before, After and AfterStep hooks
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(rb_language, tag_expressions, proc) ⇒ RbHook
constructor
A new instance of RbHook.
- #invoke(pseudo_method, arguments, &block) ⇒ Object
Constructor Details
#initialize(rb_language, tag_expressions, proc) ⇒ RbHook
Returns a new instance of RbHook.
7 8 9 10 11 12 |
# File 'lib/cucumber/rb_support/rb_hook.rb', line 7 def initialize(rb_language, tag_expressions, proc) @rb_language = rb_language @tag_expressions = tag_expressions @proc = proc @location = Cucumber::Core::Ast::Location.from_source_location(*@proc.source_location) end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
5 6 7 |
# File 'lib/cucumber/rb_support/rb_hook.rb', line 5 def location @location end |
#tag_expressions ⇒ Object (readonly)
Returns the value of attribute tag_expressions.
5 6 7 |
# File 'lib/cucumber/rb_support/rb_hook.rb', line 5 def tag_expressions @tag_expressions end |
Instance Method Details
#invoke(pseudo_method, arguments, &block) ⇒ Object
14 15 16 |
# File 'lib/cucumber/rb_support/rb_hook.rb', line 14 def invoke(pseudo_method, arguments, &block) @rb_language.current_world.cucumber_instance_exec(false, pseudo_method, *[arguments, block].flatten.compact, &@proc) end |