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.
81 82 83 84 |
# File 'lib/cucumber/core/ast/location.rb', line 81 def initialize(raw_data) super Array(raw_data).to_set @line = data.first end |
Instance Attribute Details
#data=(value) ⇒ Object
Sets the attribute data
77 78 79 |
# File 'lib/cucumber/core/ast/location.rb', line 77 def data=(value) @data = value end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
79 80 81 |
# File 'lib/cucumber/core/ast/location.rb', line 79 def line @line end |
Instance Method Details
#include?(other) ⇒ Boolean
86 87 88 89 |
# File 'lib/cucumber/core/ast/location.rb', line 86 def include?(other) return true if (data|other.data).include?(WILDCARD) other.data.subset?(data) || data.subset?(other.data) end |
#inspect ⇒ Object
95 96 97 |
# File 'lib/cucumber/core/ast/location.rb', line 95 def inspect "<#{self.class}: #{to_s}>" end |
#to_s ⇒ Object
91 92 93 |
# File 'lib/cucumber/core/ast/location.rb', line 91 def to_s boundary.join('..') end |