Module: FormObj::Mappable::ClassMethods

Defined in:
lib/form_obj/mappable.rb

Instance Method Summary collapse

Instance Method Details

#array_classObject



18
19
20
# File 'lib/form_obj/mappable.rb', line 18

def array_class
  Mappable::Array
end

#attribute_classObject



14
15
16
# File 'lib/form_obj/mappable.rb', line 14

def attribute_class
  Mappable::Attribute
end

#hash=(value) ⇒ Object



22
23
24
# File 'lib/form_obj/mappable.rb', line 22

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

#model_primary_keyObject



26
27
28
# File 'lib/form_obj/mappable.rb', line 26

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