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: 11fba05edee1c25fb85ffacb53efd1af330871ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 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