Class: Gherkin::Formatter::Model::BasicStatement
- Defined in:
- lib/gherkin/formatter/model.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #first_non_comment_line ⇒ Object
-
#initialize(comments, keyword, name, line) ⇒ BasicStatement
constructor
A new instance of BasicStatement.
- #line_range ⇒ Object
Methods inherited from Hashable
Constructor Details
#initialize(comments, keyword, name, line) ⇒ BasicStatement
Returns a new instance of BasicStatement.
10 11 12 |
# File 'lib/gherkin/formatter/model.rb', line 10 def initialize(comments, keyword, name, line) @comments, @keyword, @name, @line = comments, keyword, name, line end |
Instance Attribute Details
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
8 9 10 |
# File 'lib/gherkin/formatter/model.rb', line 8 def comments @comments end |
#keyword ⇒ Object (readonly)
Returns the value of attribute keyword.
8 9 10 |
# File 'lib/gherkin/formatter/model.rb', line 8 def keyword @keyword end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
8 9 10 |
# File 'lib/gherkin/formatter/model.rb', line 8 def line @line end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/gherkin/formatter/model.rb', line 8 def name @name end |
Instance Method Details
#first_non_comment_line ⇒ Object
19 20 21 |
# File 'lib/gherkin/formatter/model.rb', line 19 def first_non_comment_line @line end |
#line_range ⇒ Object
14 15 16 17 |
# File 'lib/gherkin/formatter/model.rb', line 14 def line_range first = @comments.any? ? @comments[0].line : first_non_comment_line first..line end |