Class: FormObj::ModelMapper::ModelPrimaryKey
- Inherits:
-
Object
- Object
- FormObj::ModelMapper::ModelPrimaryKey
- Defined in:
- lib/form_obj/model_mapper/model_primary_key.rb
Instance Method Summary collapse
-
#initialize(model_attribute) ⇒ ModelPrimaryKey
constructor
A new instance of ModelPrimaryKey.
- #name ⇒ Object
- #read_from_model(model) ⇒ Object
Constructor Details
#initialize(model_attribute) ⇒ ModelPrimaryKey
Returns a new instance of ModelPrimaryKey.
4 5 6 |
# File 'lib/form_obj/model_mapper/model_primary_key.rb', line 4 def initialize(model_attribute) @model_attribute = model_attribute end |
Instance Method Details
#name ⇒ Object
8 9 10 |
# File 'lib/form_obj/model_mapper/model_primary_key.rb', line 8 def name @model_attribute.last_name end |
#read_from_model(model) ⇒ Object
12 13 14 |
# File 'lib/form_obj/model_mapper/model_primary_key.rb', line 12 def read_from_model(model) @model_attribute.read_from_model(model, create_nested_model_if_nil: false) end |