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 94 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 114 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 98 def first data.first end
include?(other)
click to toggle source
# File lib/cucumber/core/test/location.rb, line 110 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 125 def inspect "<#{self.class}: #{to_s}>" end
max()
click to toggle source
# File lib/cucumber/core/test/location.rb, line 106 def max data.max end
min()
click to toggle source
# File lib/cucumber/core/test/location.rb, line 102 def min data.min end
to_s()
click to toggle source
# File lib/cucumber/core/test/location.rb, line 119 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 131 def range? data.size == (data.max - data.min + 1) end