Class: FactoryBot::Attribute::Association Private
- Inherits:
-
FactoryBot::Attribute
- Object
- FactoryBot::Attribute
- FactoryBot::Attribute::Association
- Defined in:
- lib/factory_bot/attribute/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.
Instance Attribute Summary collapse
- #factory ⇒ Object readonly private
Attributes inherited from FactoryBot::Attribute
Instance Method Summary collapse
- #association? ⇒ Boolean private
-
#initialize(name, factory, overrides) ⇒ Association
constructor
private
A new instance of Association.
- #to_proc ⇒ Object private
Methods inherited from FactoryBot::Attribute
Constructor Details
#initialize(name, factory, overrides) ⇒ Association
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 Association.
7 8 9 10 11 |
# File 'lib/factory_bot/attribute/association.rb', line 7 def initialize(name, factory, overrides) super(name, false) @factory = factory @overrides = overrides end |
Instance Attribute Details
#factory ⇒ 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.
5 6 7 |
# File 'lib/factory_bot/attribute/association.rb', line 5 def factory @factory end |
Instance Method Details
#association? ⇒ 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.
22 23 24 |
# File 'lib/factory_bot/attribute/association.rb', line 22 def association? true end |
#to_proc ⇒ 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.
13 14 15 16 17 18 19 20 |
# File 'lib/factory_bot/attribute/association.rb', line 13 def to_proc factory = @factory overrides = @overrides traits_and_overrides = [factory, overrides].flatten factory_name = traits_and_overrides.shift -> { association(factory_name, *traits_and_overrides) } end |