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.
25 26 27 |
# File 'lib/gherkin/formatter/model.rb', line 25 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.
23 24 25 |
# File 'lib/gherkin/formatter/model.rb', line 23 def comments @comments end |
#keyword ⇒ Object (readonly)
Returns the value of attribute keyword.
23 24 25 |
# File 'lib/gherkin/formatter/model.rb', line 23 def keyword @keyword end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
23 24 25 |
# File 'lib/gherkin/formatter/model.rb', line 23 def line @line end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/gherkin/formatter/model.rb', line 23 def name @name end |
Instance Method Details
#first_non_comment_line ⇒ Object
34 35 36 |
# File 'lib/gherkin/formatter/model.rb', line 34 def first_non_comment_line @line end |
#line_range ⇒ Object
29 30 31 32 |
# File 'lib/gherkin/formatter/model.rb', line 29 def line_range first = @comments.any? ? @comments[0].line : first_non_comment_line first..line end |