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

#lineObject (readonly)

Returns the value of attribute line.



172
173
174
# File 'lib/gherkin/formatter/model.rb', line 172

def line
  @line
end

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



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