class Cucumber::Core::Test::Location::Lines

Public Class Methods

new(raw_data) click to toggle source
Calls superclass method
# File lib/cucumber/core/test/location.rb, line 93
def initialize(raw_data)
  super Array(raw_data).to_set
end

Public Instance Methods

+(more_lines) click to toggle source
# File lib/cucumber/core/test/location.rb, line 113
def +(more_lines)
  new_data = data + more_lines.data
  self.class.new(new_data)
end
first() click to toggle source
# File lib/cucumber/core/test/location.rb, line 97
def first
  data.first
end
include?(other) click to toggle source
# File lib/cucumber/core/test/location.rb, line 109
def include?(other)
  other.data.subset?(data) || data.subset?(other.data)
end
inspect() click to toggle source
# File lib/cucumber/core/test/location.rb, line 124
def inspect
  "<#{self.class}: #{to_s}>"
end
max() click to toggle source
# File lib/cucumber/core/test/location.rb, line 105
def max
  data.max
end
min() click to toggle source
# File lib/cucumber/core/test/location.rb, line 101
def min
  data.min
end
to_s() click to toggle source
# File lib/cucumber/core/test/location.rb, line 118
def to_s
  return first.to_s if data.length == 1
  return "#{data.min}..#{data.max}" if range?
  data.to_a.join(":")
end

Protected Instance Methods

range?() click to toggle source
# File lib/cucumber/core/test/location.rb, line 130
def range?
  data.size == (data.max - data.min + 1)
end