Class: Id::Model::HasMany
- Inherits:
-
Association
- Object
- Field
- Association
- Id::Model::HasMany
- Defined in:
- lib/id/model/has_many.rb
Instance Attribute Summary
Attributes inherited from Field
Instance Method Summary collapse
Methods inherited from Association
#hierarchy, #inferred_class, #inferred_class_name, #type
Methods inherited from Field
#cast, #default, #default?, #default_value, #define, #hook_define, #initialize, #key, #optional?, #presence_of
Constructor Details
This class inherits a constructor from Id::Model::Field
Instance Method Details
#value_of(data) ⇒ Object
5 6 7 |
# File 'lib/id/model/has_many.rb', line 5 def value_of(data) data.fetch(key, []).map { |r| type.new(r) } end |