Class: Cucumber::Events::Base
- Inherits:
-
Object
- Object
- Cucumber::Events::Base
- Defined in:
- lib/cucumber/events/base.rb
Overview
An archetype of what each Cucumber Event defined in cucumber-ruby must adhere to
Direct Known Subclasses
Envelope, GherkinSourceParsed, GherkinSourceRead, HookTestStepCreated, StepActivated, StepDefinitionRegistered, TestCaseCreated, TestCaseFinished, TestCaseReady, TestCaseStarted, TestRunFinished, TestRunHookFinished, TestRunHookStarted, TestRunStarted, TestStepCreated, TestStepFinished, TestStepStarted, UndefinedParameterType
Class Method Summary collapse
-
.event_id ⇒ Object
The “key” name of the class to be used as the key in the event registry (Underscored name symbolized) @return [Symbol].
Instance Method Summary collapse
- #event_id ⇒ Object
-
#to_h ⇒ Object
The properties of each event.
Class Method Details
.event_id ⇒ Object
The “key” name of the class to be used as the key in the event registry (Underscored name symbolized)
@return [Symbol]
10 11 12 |
# File 'lib/cucumber/events/base.rb', line 10 def self.event_id raise 'Must be implemented in subclass' end |
Instance Method Details
#event_id ⇒ Object
20 21 22 |
# File 'lib/cucumber/events/base.rb', line 20 def event_id self.class.event_id end |
#to_h ⇒ Object
The properties of each event. Stored in iVar named format - where the key is the name of the iVar
@return [Hash<Symbol>]
16 17 18 |
# File 'lib/cucumber/events/base.rb', line 16 def to_h instance_variables.to_h { |variable_name| [variable_name[1..].to_sym, instance_variable_get(variable_name)] } end |