Class: Gitlab::RelativePositioning::ClosedRange

Inherits:
Range
  • Object
show all
Defined in:
lib/gitlab/relative_positioning/closed_range.rb

Instance Attribute Summary

Attributes inherited from Range

#lhs, #rhs

Instance Method Summary collapse

Methods inherited from Range

#==, #cover?, #open_on_left?, #open_on_right?

Constructor Details

#initialize(lhs, rhs) ⇒ ClosedRange

Returns a new instance of ClosedRange.

Raises:



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