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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, line) ⇒ PyString

Returns a new instance of PyString.



39
40
41
# File 'lib/gherkin/formatter/model.rb', line 39

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

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



37
38
39
# File 'lib/gherkin/formatter/model.rb', line 37

def line
  @line
end

#valueObject (readonly)

Returns the value of attribute value.



37
38
39
# File 'lib/gherkin/formatter/model.rb', line 37

def value
  @value
end

Instance Method Details

#line_rangeObject



43
44
45
46
# File 'lib/gherkin/formatter/model.rb', line 43

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