Class: Cucumber::Core::Ast::Location::Lines
- Inherits:
-
Struct
- Object
- Struct
- Cucumber::Core::Ast::Location::Lines
- Defined in:
- lib/cucumber/core/ast/location.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
writeonly
Sets the attribute data.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
- #include?(other) ⇒ Boolean
-
#initialize(raw_data) ⇒ Lines
constructor
A new instance of Lines.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(raw_data) ⇒ Lines
Returns a new instance of Lines.
65 66 67 68 69 70 71 |
# File 'lib/cucumber/core/ast/location.rb', line 65 def initialize(raw_data) if Cucumber::JRUBY && raw_data.is_a?(::Java::GherkinFormatterModel::Range) raw_data = Range.new(raw_data.first, raw_data.last) end super Array(raw_data).to_set @line = data.first end |
Instance Attribute Details
#data=(value) ⇒ Object
Sets the attribute data
61 62 63 |
# File 'lib/cucumber/core/ast/location.rb', line 61 def data=(value) @data = value end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
63 64 65 |
# File 'lib/cucumber/core/ast/location.rb', line 63 def line @line end |
Instance Method Details
#include?(other) ⇒ Boolean
73 74 75 76 |
# File 'lib/cucumber/core/ast/location.rb', line 73 def include?(other) return true if (data|other.data).include?(WILDCARD) other.data.subset?(data) || data.subset?(other.data) end |
#inspect ⇒ Object
82 83 84 |
# File 'lib/cucumber/core/ast/location.rb', line 82 def inspect "<#{self.class}: #{to_s}>" end |
#to_s ⇒ Object
78 79 80 |
# File 'lib/cucumber/core/ast/location.rb', line 78 def to_s boundary.join('..') end |