Class: ROM::Factory::Attributes::Association::Core Private

Inherits:
Object
  • Object
show all
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

ManyToMany, ManyToOne, OneToMany

Instance Attribute Summary collapse

Instance Method Summary collapse

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, **options)
  @assoc = assoc
  @builder_proc = builder
  @traits = traits
  @options = options
end

Instance Attribute Details

#assocObject (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

#optionsObject (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
  @options
end

#traitsObject (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

#builderObject

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.



30
31
32
# File 'lib/rom/factory/attributes/association.rb', line 30

def builder
  @__builder__ ||= @builder_proc.call
end

#countObject

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.



50
# File 'lib/rom/factory/attributes/association.rb', line 50

def count = options.fetch(:count, 1)

#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.

Returns:

  • (Boolean)


38
# File 'lib/rom/factory/attributes/association.rb', line 38

def dependency?(*) = false

#factoriesObject

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.



44
# File 'lib/rom/factory/attributes/association.rb', line 44

def factories = builder.factories

#foreign_keyObject

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
# File 'lib/rom/factory/attributes/association.rb', line 47

def foreign_key = assoc.foreign_key

#nameObject

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.



35
# File 'lib/rom/factory/attributes/association.rb', line 35

def name = assoc.key

#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.

Returns:

  • (Boolean)


27
# File 'lib/rom/factory/attributes/association.rb', line 27

def through? = false

#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.

Returns:

  • (Boolean)


41
# File 'lib/rom/factory/attributes/association.rb', line 41

def value? = false