Class: Gitlab::RelativePositioning::ClosedRange
- Defined in:
- lib/gitlab/relative_positioning/closed_range.rb
Instance Attribute Summary
Attributes inherited from Range
Instance Method Summary collapse
-
#initialize(lhs, rhs) ⇒ ClosedRange
constructor
A new instance of ClosedRange.
Methods inherited from Range
#==, #cover?, #open_on_left?, #open_on_right?
Constructor Details
#initialize(lhs, rhs) ⇒ ClosedRange
Returns a new instance of ClosedRange.
6 7 8 9 10 11 |
# File 'lib/gitlab/relative_positioning/closed_range.rb', line 6 def initialize(lhs, rhs) @lhs = lhs @rhs = rhs raise IllegalRange, 'Either lhs or rhs is missing' unless lhs && rhs raise IllegalRange, 'lhs and rhs cannot be the same object' if lhs == rhs end |