debian-mirror-gitlab/lib/gitlab/relative_positioning/closed_range.rb

15 lines
381 B
Ruby
Raw Normal View History

2021-04-17 20:07:23 +05:30
# frozen_string_literal: true
module Gitlab
module RelativePositioning
class ClosedRange < RelativePositioning::Range
def initialize(lhs, rhs)
2021-04-29 21:17:54 +05:30
@lhs = lhs
@rhs = rhs
2021-04-17 20:07:23 +05:30
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