Class: Cucumber::Wire::StepDefinition
- Inherits:
-
Object
- Object
- Cucumber::Wire::StepDefinition
- Defined in:
- lib/cucumber/wire/step_definition.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#regexp_source ⇒ Object
readonly
Returns the value of attribute regexp_source.
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Method Summary collapse
-
#initialize(connection, data, registry) ⇒ StepDefinition
constructor
A new instance of StepDefinition.
- #invoke(args) ⇒ Object
Constructor Details
#initialize(connection, data, registry) ⇒ StepDefinition
Returns a new instance of StepDefinition.
8 9 10 11 12 13 14 15 |
# File 'lib/cucumber/wire/step_definition.rb', line 8 def initialize(connection, data, registry) @connection = connection @registry = registry @id = data['id'] @regexp_source = Regexp.new(data['regexp']) rescue data['regexp'] || "Unknown" @expression = registry.create_expression(@regexp_source) @location = Core::Test::Location.from_file_colon_line(data['source'] || "unknown:0") end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
6 7 8 |
# File 'lib/cucumber/wire/step_definition.rb', line 6 def expression @expression end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
6 7 8 |
# File 'lib/cucumber/wire/step_definition.rb', line 6 def location @location end |
#regexp_source ⇒ Object (readonly)
Returns the value of attribute regexp_source.
6 7 8 |
# File 'lib/cucumber/wire/step_definition.rb', line 6 def regexp_source @regexp_source end |
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
6 7 8 |
# File 'lib/cucumber/wire/step_definition.rb', line 6 def registry @registry end |
Instance Method Details
#invoke(args) ⇒ Object
17 18 19 |
# File 'lib/cucumber/wire/step_definition.rb', line 17 def invoke(args) @connection.invoke(@id, args) end |