Module: Datamappify::Data::Record

Defined in:
lib/datamappify/data/record.rb

Overview

A convenient class for finding or building a data record

Class Method Summary collapse

Class Method Details

.build_association(attribute, default_source_class) ⇒ void

This method returns an undefined value.

Parameters:

  • attribute (Attribute)
  • default_source_class (Class)


20
21
22
# File 'lib/datamappify/data/record.rb', line 20

def build_association(attribute, default_source_class)
  Provider.const_get(attribute.provider_name).build_record_association(attribute, default_source_class)
end

.build_reversed_association(attribute, default_source_class) ⇒ Object



24
25
26
# File 'lib/datamappify/data/record.rb', line 24

def build_reversed_association(attribute, default_source_class)
  Provider.const_get(attribute.provider_name).build_record_reversed_association(attribute, default_source_class)
end

.find_or_build(provider_name, source_class_name) ⇒ Object

Parameters:

  • provider_name (String)

Returns:

  • (Object)


11
12
13
# File 'lib/datamappify/data/record.rb', line 11

def find_or_build(provider_name, source_class_name)
  Provider.const_get(provider_name).find_or_build_record_class(source_class_name)
end