Class: ROM::Factory::Attributes::Association::OneToMany Private
- Defined in:
- lib/rom/factory/attributes/association.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Instance Method Summary collapse
- #call(attrs = EMPTY_HASH, parent) ⇒ Object private
- #count ⇒ Object private
- #dependency?(rel) ⇒ Boolean private
Constructor Details
This class inherits a constructor from ROM::Factory::Attributes::Association::Core
Instance Method Details
#call(attrs = EMPTY_HASH, parent) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
64 65 66 67 68 69 70 71 72 |
# File 'lib/rom/factory/attributes/association.rb', line 64 def call(attrs = EMPTY_HASH, parent) return if attrs.key?(name) structs = count.times.map { builder.persistable.create(assoc.associate(attrs, parent)) } { name => structs } end |
#count ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
80 81 82 |
# File 'lib/rom/factory/attributes/association.rb', line 80 def count .fetch(:count) end |
#dependency?(rel) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
75 76 77 |
# File 'lib/rom/factory/attributes/association.rb', line 75 def dependency?(rel) assoc.source == rel end |