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.



200
201
202
# File 'lib/gherkin/formatter/model.rb', line 200

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

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



198
199
200
# File 'lib/gherkin/formatter/model.rb', line 198

def line
  @line
end

#valueObject (readonly)

Returns the value of attribute value.



198
199
200
# File 'lib/gherkin/formatter/model.rb', line 198

def value
  @value
end

Instance Method Details

#line_rangeObject



204
205
206
207
# File 'lib/gherkin/formatter/model.rb', line 204

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