Class: Cucumber::Core::Ast::Location::Lines
- Inherits:
-
Object
- Object
- Cucumber::Core::Ast::Location::Lines
- Defined in:
- lib/cucumber/core/ast/location.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #include?(other) ⇒ Boolean
-
#initialize(line) ⇒ Lines
constructor
A new instance of Lines.
- #to_s ⇒ Object
Constructor Details
#initialize(line) ⇒ Lines
Returns a new instance of Lines.
54 55 56 57 58 59 60 |
# File 'lib/cucumber/core/ast/location.rb', line 54 def initialize(line) if Cucumber::JRUBY && line.is_a?(::Java::GherkinFormatterModel::Range) line = Range.new(line.first, line.last) end @line = line @data = Array(line).to_set end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
53 54 55 |
# File 'lib/cucumber/core/ast/location.rb', line 53 def line @line end |
Instance Method Details
#==(other) ⇒ Object
71 72 73 |
# File 'lib/cucumber/core/ast/location.rb', line 71 def ==(other) other.data == data end |
#include?(other) ⇒ Boolean
62 63 64 65 |
# File 'lib/cucumber/core/ast/location.rb', line 62 def include?(other) return true if (data|other.data).include?(WILDCARD) other.data.subset?(data) || data.subset?(other.data) end |
#to_s ⇒ Object
67 68 69 |
# File 'lib/cucumber/core/ast/location.rb', line 67 def to_s boundary.join('..') end |