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

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

module Gitlab
  module RelativePositioning
    class EndingAt < RelativePositioning::Range
      include Gitlab::Utils::StrongMemoize

      def initialize(rhs)
        @rhs = rhs
        raise IllegalRange, 'rhs is required' unless rhs
      end

      def lhs
        strong_memoize(:lhs) { rhs.lhs_neighbour }
      end
    end
  end
end