Class: Cucumber::Core::Test::Location::Lines
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/location.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
writeonly
Sets the attribute data.
Instance Method Summary collapse
- #+(other) ⇒ Object
- #first ⇒ Object
- #include?(other) ⇒ Boolean
-
#initialize(raw_data) ⇒ Lines
constructor
A new instance of Lines.
- #inspect ⇒ Object
- #max ⇒ Object
- #min ⇒ Object
- #to_s ⇒ Object
Methods inherited from Struct
Constructor Details
Instance Attribute Details
#data=(value) ⇒ Object
Sets the attribute data
92 93 94 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/location.rb', line 92 def data=(value) @data = value end |
Instance Method Details
#+(other) ⇒ Object
115 116 117 118 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/location.rb', line 115 def +(other) new_data = data + other.data self.class.new(new_data) end |
#first ⇒ Object
99 100 101 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/location.rb', line 99 def first data.first end |
#include?(other) ⇒ Boolean
111 112 113 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/location.rb', line 111 def include?(other) other.data.subset?(data) || data.subset?(other.data) end |
#inspect ⇒ Object
127 128 129 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/location.rb', line 127 def inspect "<#{self.class}: #{self}>" end |
#max ⇒ Object
107 108 109 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/location.rb', line 107 def max data.max end |
#min ⇒ Object
103 104 105 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/location.rb', line 103 def min data.min end |
#to_s ⇒ Object
120 121 122 123 124 125 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/location.rb', line 120 def to_s return first.to_s if data.length == 1 return "#{data.min}..#{data.max}" if range? data.to_a.join(":") end |