Module: Querifier::Queries::Base

Defined in:
lib/querifier/queries/base.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



17
18
19
# File 'lib/querifier/queries/base.rb', line 17

def self.included(klass)
  klass.extend(ClassMethods)
end

Instance Method Details

#collectionObject



9
10
11
# File 'lib/querifier/queries/base.rb', line 9

def collection
  @collection ||= self.class.default_collection
end

#initialize(params) ⇒ Object



4
5
6
7
# File 'lib/querifier/queries/base.rb', line 4

def initialize(params)
  @params = params
  check_params!
end

#paramsObject



13
14
15
# File 'lib/querifier/queries/base.rb', line 13

def params
  @params.fetch(Config.filter_param, {})
end