Class: Cucumber::Formatter::LegacyApi::Ast::Comments

Inherits:
Struct
  • Object
show all
Defined in:
lib/cucumber/formatter/legacy_api/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commentsObject

Returns the value of attribute comments



57
58
59
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 57

def comments
  @comments
end

Instance Method Details

#accept(formatter) ⇒ Object



58
59
60
61
62
63
64
65
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 58

def accept(formatter)
  return if comments.empty?
  formatter.before_comment comments
  comments.each do |comment|
    formatter.comment_line comment.to_s.strip
  end
  formatter.after_comment comments
end