Class: Gherkin::Formatter::Model::PyString

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, line) ⇒ PyString

Returns a new instance of PyString.



187
188
189
# File 'lib/gherkin/formatter/model.rb', line 187

def initialize(value, line)
  @value, @line = value, line
end

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



185
186
187
# File 'lib/gherkin/formatter/model.rb', line 185

def line
  @line
end

#valueObject (readonly)

Returns the value of attribute value.



185
186
187
# File 'lib/gherkin/formatter/model.rb', line 185

def value
  @value
end

Instance Method Details

#line_rangeObject



191
192
193
194
# File 'lib/gherkin/formatter/model.rb', line 191

def line_range
  line_count = value.split(/\r?\n/).length
  line..(line+line_count+1)
end