Class: ROM::Factory::Attributes::Association::Core Private
- Inherits:
-
Object
- Object
- ROM::Factory::Attributes::Association::Core
- 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 Attribute Summary collapse
- #assoc ⇒ Object readonly private
- #options ⇒ Object readonly private
- #traits ⇒ Object readonly private
Instance Method Summary collapse
- #builder ⇒ Object private
- #count ⇒ Object private
- #dependency? ⇒ Boolean private
- #factories ⇒ Object private
- #foreign_key ⇒ Object private
-
#initialize(assoc, builder, *traits, **options) ⇒ Core
constructor
private
A new instance of Core.
- #name ⇒ Object private
- #through? ⇒ Boolean private
- #value? ⇒ Boolean private
Constructor Details
#initialize(assoc, builder, *traits, **options) ⇒ Core
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.
Returns a new instance of Core.
19 20 21 22 23 24 |
# File 'lib/rom/factory/attributes/association.rb', line 19 def initialize(assoc, builder, *traits, **) @assoc = assoc @builder_proc = builder @traits = traits @options = end |
Instance Attribute Details
#assoc ⇒ Object (readonly)
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.
16 17 18 |
# File 'lib/rom/factory/attributes/association.rb', line 16 def assoc @assoc end |
#options ⇒ Object (readonly)
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.
16 17 18 |
# File 'lib/rom/factory/attributes/association.rb', line 16 def @options end |
#traits ⇒ Object (readonly)
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.
16 17 18 |
# File 'lib/rom/factory/attributes/association.rb', line 16 def traits @traits end |
Instance Method Details
#builder ⇒ 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.
32 33 34 |
# File 'lib/rom/factory/attributes/association.rb', line 32 def builder @__builder__ ||= @builder_proc.call 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.
62 63 64 |
# File 'lib/rom/factory/attributes/association.rb', line 62 def count .fetch(:count, 1) end |
#dependency? ⇒ 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.
42 43 44 |
# File 'lib/rom/factory/attributes/association.rb', line 42 def dependency?(*) false end |
#factories ⇒ 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.
52 53 54 |
# File 'lib/rom/factory/attributes/association.rb', line 52 def factories builder.factories end |
#foreign_key ⇒ 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.
57 58 59 |
# File 'lib/rom/factory/attributes/association.rb', line 57 def foreign_key assoc.foreign_key end |
#name ⇒ 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.
37 38 39 |
# File 'lib/rom/factory/attributes/association.rb', line 37 def name assoc.key end |
#through? ⇒ 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.
27 28 29 |
# File 'lib/rom/factory/attributes/association.rb', line 27 def through? false end |
#value? ⇒ 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.
47 48 49 |
# File 'lib/rom/factory/attributes/association.rb', line 47 def value? false end |