Class: Gitlab::Graphql::Pagination::Keyset::Conditions::BaseCondition

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/graphql/pagination/keyset/conditions/base_condition.rb

Direct Known Subclasses

NotNullCondition, NullCondition

Instance Method Summary collapse

Constructor Details

#initialize(arel_table, order_list, values, operators, before_or_after) ⇒ BaseCondition

Returns a new instance of BaseCondition.

Parameters:

  • arel_table (Arel::Table)

    for the relation being ordered

  • order_list (Array<OrderInfo>)

    of extracted orderings

  • values (Array)

    from the decoded cursor

  • operators (Array<String>)

    determining sort comparison

  • before_or_after (Symbol)

    indicates whether we want items :before the cursor or :after the cursor


15
16
17
18
19
20
21
22
23
# File 'lib/gitlab/graphql/pagination/keyset/conditions/base_condition.rb', line 15

def initialize(arel_table, order_list, values, operators, before_or_after)
  @arel_table = arel_table
  @order_list = order_list
  @values = values
  @operators = operators
  @before_or_after = before_or_after

  @before_or_after = :after unless [:after, :before].include?(@before_or_after)
end

Instance Method Details

#buildObject

Raises:

  • (NotImplementedError)

25
26
27
# File 'lib/gitlab/graphql/pagination/keyset/conditions/base_condition.rb', line 25

def build
  raise NotImplementedError
end