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

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

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Builder

Returns a new instance of Builder.



162
163
164
165
166
# File 'lib/gherkin/formatter/model.rb', line 162

def initialize(*args)
  @args = *args
  @rows = nil
  @doc_string = nil
end

Instance Method Details

#buildObject



181
182
183
# File 'lib/gherkin/formatter/model.rb', line 181

def build
  Step.new(*(@args << @rows << @doc_string))
end

#doc_string(string, content_type, line) ⇒ Object



173
174
175
# File 'lib/gherkin/formatter/model.rb', line 173

def doc_string(string, content_type, line)
  @doc_string = Formatter::Model::DocString.new(string, content_type, line)
end

#replay(formatter) ⇒ Object



177
178
179
# File 'lib/gherkin/formatter/model.rb', line 177

def replay(formatter)
  build.replay(formatter)
end

#row(comments, cells, line, id) ⇒ Object



168
169
170
171
# File 'lib/gherkin/formatter/model.rb', line 168

def row(comments, cells, line, id)
  @rows ||= []
  @rows << DataTableRow.new(comments, cells, line)
end