Class: Gherkin::Formatter::Model::Step

Inherits:
BasicStatement show all
Defined in:
lib/gherkin/formatter/model.rb

Instance Attribute Summary collapse

Attributes inherited from BasicStatement

#comments, #keyword, #line, #name

Instance Method Summary collapse

Methods inherited from BasicStatement

#first_non_comment_line, #initialize

Methods inherited from Hashable

#to_hash

Constructor Details

This class inherits a constructor from Gherkin::Formatter::Model::BasicStatement

Instance Attribute Details

#doc_stringObject

Returns the value of attribute doc_string.



116
117
118
# File 'lib/gherkin/formatter/model.rb', line 116

def doc_string
  @doc_string
end

#rowsObject

Returns the value of attribute rows.



115
116
117
# File 'lib/gherkin/formatter/model.rb', line 115

def rows
  @rows
end

Instance Method Details

#line_rangeObject



118
119
120
121
122
123
124
125
126
# File 'lib/gherkin/formatter/model.rb', line 118

def line_range
  range = super
  if(rows)
    range = range.first..rows[-1].line
  elsif(doc_string)
    range = range.first..doc_string.line_range.last
  end
  range
end

#outline_argsObject



132
133
134
135
136
137
138
# File 'lib/gherkin/formatter/model.rb', line 132

def outline_args
  offset = 0
  name.scan(/<[^<]*>/).map do |val|
    offset = name.index(val, offset)
    Argument.new(offset, val)
  end
end

#replay(formatter) ⇒ Object



128
129
130
# File 'lib/gherkin/formatter/model.rb', line 128

def replay(formatter)
  formatter.step(self)
end