Class: Cucumber::Core::Gherkin::AstBuilder::StepBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/cucumber/core/gherkin/ast_builder.rb

Direct Known Subclasses

OutlineStepBuilder

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Builder

#handle_comments

Constructor Details

#initializeStepBuilder

Returns a new instance of StepBuilder.



209
210
211
212
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 209

def initialize(*)
  super
  @multiline_argument_builder = attributes[:argument] ? argument_builder(attributes[:argument]) : nil
end

Instance Attribute Details

#multiline_argument_builderObject (readonly)

Returns the value of attribute multiline_argument_builder.



207
208
209
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 207

def multiline_argument_builder
  @multiline_argument_builder
end

Instance Method Details

#childrenObject



230
231
232
233
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 230

def children
  return [] unless multiline_argument_builder
  [multiline_argument_builder]
end

#multiline_argumentObject



225
226
227
228
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 225

def multiline_argument
  return Ast::EmptyMultilineArgument.new unless multiline_argument_builder
  multiline_argument_builder.result
end

#result(language) ⇒ Object



214
215
216
217
218
219
220
221
222
223
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 214

def result(language)
  Ast::Step.new(
    language,
    location,
    comments,
    keyword,
    attributes[:text],
    multiline_argument
  )
end