Module: Datamappify::Repository::Inheritable

Defined in:
lib/datamappify/repository/inheritable.rb

Instance Method Summary collapse

Instance Method Details

#inherited(klass) ⇒ void

This method returns an undefined value.

Parameters:



7
8
9
10
11
12
13
# File 'lib/datamappify/repository/inheritable.rb', line 7

def inherited(klass)
  klass.class_eval { include Repository }

  setup_data_mapper(klass)

  klass.data_mapper.default_source_class
end

#setup_data_mapper(klass) ⇒ void (private)

This method returns an undefined value.

Parameters:



20
21
22
23
24
25
# File 'lib/datamappify/repository/inheritable.rb', line 20

def setup_data_mapper(klass)
  klass.for_entity       self.data_mapper.entity_class
  klass.default_provider self.data_mapper.default_provider_name

  klass.data_mapper.custom_mapping = self.data_mapper.custom_mapping.dup
end