Module: FormObj::ModelMapper::ClassMethods

Defined in:
lib/form_obj/model_mapper.rb

Instance Method Summary collapse

Instance Method Details

#array_classObject



19
20
21
# File 'lib/form_obj/model_mapper.rb', line 19

def array_class
  ModelMapper::Array
end

#attribute_classObject



15
16
17
# File 'lib/form_obj/model_mapper.rb', line 15

def attribute_class
  ModelMapper::Attribute
end

#model_hash=(value) ⇒ Object



23
24
25
# File 'lib/form_obj/model_mapper.rb', line 23

def model_hash=(value)
  _attributes.each { |attribute| attribute.model_attribute.hash_item = value }
end

#model_primary_keyObject



27
28
29
# File 'lib/form_obj/model_mapper.rb', line 27

def model_primary_key
  ModelMapper::ModelPrimaryKey.new(self._attributes.find(self.primary_key).model_attribute)
end