debian-mirror-gitlab/lib/gitlab/relative_positioning/closed_range.rb
2021-04-29 21:17:54 +05:30

15 lines
381 B
Ruby

# frozen_string_literal: true
module Gitlab
module RelativePositioning
class ClosedRange < RelativePositioning::Range
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
end
end
end