Class: GraphQL::FancyLoader::PaginationFilter
- Inherits:
-
Object
- Object
- GraphQL::FancyLoader::PaginationFilter
- Defined in:
- lib/graphql/fancy_loader/pagination_filter.rb
Instance Method Summary collapse
- #arel ⇒ Object
-
#initialize(query, before: nil, after: nil, first: nil, last: nil) ⇒ PaginationFilter
constructor
A new instance of PaginationFilter.
Constructor Details
#initialize(query, before: nil, after: nil, first: nil, last: nil) ⇒ PaginationFilter
Returns a new instance of PaginationFilter.
4 5 6 7 8 9 10 |
# File 'lib/graphql/fancy_loader/pagination_filter.rb', line 4 def initialize(query, before: nil, after: nil, first: nil, last: nil) @query = query @before = before @after = after @first = first @last = last end |
Instance Method Details
#arel ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/graphql/fancy_loader/pagination_filter.rb', line 12 def arel [ after_filter, before_filter, first_filter, last_filter ].compact.inject(&:and) end |