Class: YARD::CodeObjects::StepTransformerObject

Inherits:
Base
  • Object
show all
Includes:
Cucumber::LocationHelper
Defined in:
lib/yard/code_objects/step_transformer.rb

Direct Known Subclasses

StepDefinitionObject, StepTransformObject

Constant Summary collapse

ESCAPE_PATTERN =
/#\{\s*(\w+)\s*\}/

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Cucumber::LocationHelper

#file, #line_number, #location

Instance Attribute Details

#constantsObject (readonly)

Returns the value of attribute constants.



8
9
10
# File 'lib/yard/code_objects/step_transformer.rb', line 8

def constants
  @constants
end

#keywordObject (readonly)

Returns the value of attribute keyword.



8
9
10
# File 'lib/yard/code_objects/step_transformer.rb', line 8

def keyword
  @keyword
end

#literal_valueObject (readonly)

Returns the value of attribute literal_value.



8
9
10
# File 'lib/yard/code_objects/step_transformer.rb', line 8

def literal_value
  @literal_value
end

#sourceObject (readonly)

Returns the value of attribute source.



8
9
10
# File 'lib/yard/code_objects/step_transformer.rb', line 8

def source
  @source
end

#stepsObject

Returns the value of attribute steps.



9
10
11
# File 'lib/yard/code_objects/step_transformer.rb', line 9

def steps
  @steps
end

#valueObject

Returns the value of attribute value.



8
9
10
# File 'lib/yard/code_objects/step_transformer.rb', line 8

def value
  @value
end

Instance Method Details

#constants_from_value(data = @value) ⇒ Object



28
29
30
# File 'lib/yard/code_objects/step_transformer.rb', line 28

def constants_from_value(data=@value)
  data.scan(ESCAPE_PATTERN).flatten.collect { |value| value.strip }
end

#regexObject



24
25
26
# File 'lib/yard/code_objects/step_transformer.rb', line 24

def regex
  @regex ||= /#{strip_regex_from(@value)}/
end