Module: Datamappify::Data::Provider::CommonProvider

Included in:
ActiveRecord, Sequel
Defined in:
lib/datamappify/data/provider/common_provider.rb

Defined Under Namespace

Modules: ModuleMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(klass) ⇒ Object



5
6
7
8
9
# File 'lib/datamappify/data/provider/common_provider.rb', line 5

def self.extended(klass)
  klass.extend ModuleMethods

  klass.load_criterias
end

Instance Method Details

#build_criteria(name, *args) { ... } ⇒ Object

Builds a Criteria

Parameters:

  • name (Symbol)
  • args (any)

Yields:



93
94
95
# File 'lib/datamappify/data/provider/common_provider.rb', line 93

def build_criteria(name, *args, &block)
  Data::Criteria.const_get(class_name).const_get(name).new(*args, &block).perform_with_callbacks
end