Module: ParamsReady::Pagination::Direction::After
Class Method Summary
collapse
build_cursor, check_primary_keys_presence, cursor_predicate, cursor_predicates, instance, non_nullable_predicate, nullable_predicate, pk_predicate
Class Method Details
.invert_ordering? ⇒ Boolean
120
121
122
|
# File 'lib/params_ready/pagination/direction.rb', line 120
def self.invert_ordering?
false
end
|
.keysets(last, keysets, &block) ⇒ Object
142
143
144
|
# File 'lib/params_ready/pagination/direction.rb', line 142
def self.keysets(last, keysets, &block)
AfterKeysets.new(last, keysets, &block)
end
|
.nulls_strategy(strategy) ⇒ Object
133
134
135
136
137
138
139
140
|
# File 'lib/params_ready/pagination/direction.rb', line 133
def self.nulls_strategy(strategy)
case strategy
when :first then Nulls::First
when :last then Nulls::Last
else
raise ParamsReadyError, "Unexpected nulls strategy: '#{strategy}'"
end
end
|
.tendency(ordering) ⇒ Object
124
125
126
127
128
129
130
131
|
# File 'lib/params_ready/pagination/direction.rb', line 124
def self.tendency(ordering)
case ordering
when :asc then Tendency::Growing
when :desc then Tendency::Falling
else
raise ParamsReadyError, "Unexpected ordering: '#{ordering}'"
end
end
|