gitlab-org--gitlab-foss/lib/gitlab/relative_positioning/closed_range.rb

15 lines
381 B
Ruby
Raw Normal View History

# 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