Class: Gherkin::Formatter::Model::DocString

Inherits:
Hashable
  • Object
show all
Defined in:
lib/gherkin/formatter/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Hashable

#to_hash

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_typeObject (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

#lineObject (readonly)

Returns the value of attribute line.



218
219
220
# File 'lib/gherkin/formatter/model.rb', line 218

def line
  @line
end

#valueObject (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_rangeObject



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