Class: Gherkin::Formatter::Model::DocString
- Defined in:
- lib/gherkin/formatter/model.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(content_type, value, line) ⇒ DocString
constructor
A new instance of DocString.
- #line_range ⇒ Object
Methods inherited from Hashable
Constructor Details
#initialize(content_type, value, line) ⇒ DocString
Returns a new instance of DocString.
174 175 176 |
# File 'lib/gherkin/formatter/model.rb', line 174 def initialize(content_type, value, line) @content_type, @value, @line = content_type, value, line end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
172 173 174 |
# File 'lib/gherkin/formatter/model.rb', line 172 def content_type @content_type end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
172 173 174 |
# File 'lib/gherkin/formatter/model.rb', line 172 def line @line end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
172 173 174 |
# File 'lib/gherkin/formatter/model.rb', line 172 def value @value end |
Instance Method Details
#line_range ⇒ Object
178 179 180 181 |
# File 'lib/gherkin/formatter/model.rb', line 178 def line_range line_count = value.split(/\r?\n/).length line..(line+line_count+1) end |