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.



32
33
34
# File 'lib/rom/factory/attributes/association.rb', line 32

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.



62
63
64
# File 'lib/rom/factory/attributes/association.rb', line 62

def count
  options.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.

Returns:

  • (Boolean)


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

def dependency?(*)
  false
end

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



52
53
54
# File 'lib/rom/factory/attributes/association.rb', line 52

def factories
  builder.factories
end

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



57
58
59
# File 'lib/rom/factory/attributes/association.rb', line 57

def foreign_key
  assoc.foreign_key
end

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



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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


47
48
49
# File 'lib/rom/factory/attributes/association.rb', line 47

def value?
  false
end