Class: Cucumber::Wire::StepDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/wire/step_definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, data) ⇒ StepDefinition

Returns a new instance of StepDefinition.



8
9
10
11
12
13
# File 'lib/cucumber/wire/step_definition.rb', line 8

def initialize(connection, data)
  @connection = connection
  @id              = data['id']
  @regexp_source   = data['regexp'] || "Unknown"
  @location        = Core::Ast::Location.from_file_colon_line(data['source'] || "unknown:0")
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



6
7
8
# File 'lib/cucumber/wire/step_definition.rb', line 6

def location
  @location
end

#regexp_sourceObject (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

Instance Method Details

#invoke(args) ⇒ Object



15
16
17
# File 'lib/cucumber/wire/step_definition.rb', line 15

def invoke(args)
  @connection.invoke(@id, args)
end