Class: AbstractFinder

Inherits:
BaseFinder show all
Defined in:
lib/abstract_finder.rb

Overview

AbstractFinder

Constant Summary collapse

SORT =
%w[asc desc].freeze

Constants inherited from BaseFinder

BaseFinder::DEFAULT_PER_PAGE

Instance Attribute Summary collapse

Attributes inherited from BaseFinder

#collection

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseFinder

#meta, #page, #per_page, #total

Constructor Details

#initialize(model, associations, args) ⇒ AbstractFinder

rubocop:disable Lint/MissingSuper



13
14
15
16
17
# File 'lib/abstract_finder.rb', line 13

def initialize(model, associations, args) # rubocop:disable Lint/MissingSuper
  @model = model
  @associations = associations
  @filters = args
end

Instance Attribute Details

#associationsObject (readonly)

Returns the value of attribute associations.



5
6
7
# File 'lib/abstract_finder.rb', line 5

def associations
  @associations
end

#modelObject (readonly)

Returns the value of attribute model.



5
6
7
# File 'lib/abstract_finder.rb', line 5

def model
  @model
end

Class Method Details

.call(model, associations = [], args = []) ⇒ Object



9
10
11
# File 'lib/abstract_finder.rb', line 9

def self.call(model, associations = [], args = [])
  new(model, associations, args).call
end

Instance Method Details

#callObject



19
20
21
22
23
# File 'lib/abstract_finder.rb', line 19

def call
  load_collection

  self
end