Class: ROM::Factory::Builder Private

Inherits:
Object
  • Object
show all
Includes:
Dry::Core::Constants
Defined in:
lib/rom/factory/builder.rb,
lib/rom/factory/builder/persistable.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.

Defined Under Namespace

Classes: Persistable

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes, relation) ⇒ Builder

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



18
19
20
21
# File 'lib/rom/factory/builder.rb', line 18

def initialize(attributes, relation)
  @attributes = attributes
  @tuple_evaluator = TupleEvaluator.new(attributes, relation)
end

Instance Attribute Details

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



12
13
14
# File 'lib/rom/factory/builder.rb', line 12

def attributes
  @attributes
end

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



15
16
17
# File 'lib/rom/factory/builder.rb', line 15

def tuple_evaluator
  @tuple_evaluator
end

Instance Method Details

#persistableObject

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
36
37
# File 'lib/rom/factory/builder.rb', line 35

def persistable
  Persistable.new(self)
end

#relationObject

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.



40
41
42
# File 'lib/rom/factory/builder.rb', line 40

def relation
  tuple_evaluator.relation
end

#struct(attrs = EMPTY_HASH) ⇒ Object Also known as: create

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.



29
30
31
# File 'lib/rom/factory/builder.rb', line 29

def struct(attrs = EMPTY_HASH)
  tuple_evaluator.struct(attrs)
end

#tuple(attrs = EMPTY_HASH) ⇒ 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.



24
25
26
# File 'lib/rom/factory/builder.rb', line 24

def tuple(attrs = EMPTY_HASH)
  tuple_evaluator.defaults(attrs)
end