Welcome to mirror list, hosted at ThFree Co, Russian Federation.

closed_range.rb « relative_positioning « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8916d1face5cb8b0d98cba9eeacd14a7a270920d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

module Gitlab
  module RelativePositioning
    class ClosedRange < RelativePositioning::Range
      def initialize(lhs, rhs)
        @lhs, @rhs = lhs, 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