class Cucumber::Core::Ast::Location::Lines
Public Class Methods
new(raw_data)
click to toggle source
Calls superclass method
# File lib/cucumber/core/ast/location.rb, line 105 def initialize(raw_data) super Array(raw_data).to_set end
Public Instance Methods
+(more_lines)
click to toggle source
# File lib/cucumber/core/ast/location.rb, line 117 def +(more_lines) new_data = data + more_lines.data self.class.new(new_data) end
first()
click to toggle source
# File lib/cucumber/core/ast/location.rb, line 109 def first data.first end
include?(other)
click to toggle source
# File lib/cucumber/core/ast/location.rb, line 113 def include?(other) other.data.subset?(data) || data.subset?(other.data) end
inspect()
click to toggle source
# File lib/cucumber/core/ast/location.rb, line 128 def inspect "<#{self.class}: #{to_s}>" end
to_s()
click to toggle source
# File lib/cucumber/core/ast/location.rb, line 122 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/ast/location.rb, line 134 def range? data.size == (data.max - data.min + 1) end