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(value, content_type, line) ⇒ DocString
constructor
A new instance of DocString.
- #line_range ⇒ Object
Methods inherited from Hashable
Constructor Details
#initialize(value, content_type, line) ⇒ DocString
Returns a new instance of DocString.
220 221 222 |
# File 'lib/gherkin/formatter/model.rb', line 220 def initialize(value, content_type, line) @value, @content_type, @line = value, content_type, line end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
218 219 220 |
# File 'lib/gherkin/formatter/model.rb', line 218 def content_type @content_type end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
218 219 220 |
# File 'lib/gherkin/formatter/model.rb', line 218 def line @line end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
218 219 220 |
# File 'lib/gherkin/formatter/model.rb', line 218 def value @value end |
Instance Method Details
#line_range ⇒ Object
224 225 226 227 |
# File 'lib/gherkin/formatter/model.rb', line 224 def line_range line_count = value.split(/\r?\n/).length line..(line+line_count+1) end |