Class: ROM::Factory::Builder Private
- Inherits:
-
Object
- Object
- ROM::Factory::Builder
- 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
- #attributes ⇒ Object readonly private
- #tuple_evaluator ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(attributes, relation) ⇒ Builder
constructor
private
A new instance of Builder.
- #persistable ⇒ Object private
- #relation ⇒ Object private
- #struct(attrs = EMPTY_HASH) ⇒ Object (also: #create) private
- #tuple(attrs = EMPTY_HASH) ⇒ Object private
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
#attributes ⇒ 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.
12 13 14 |
# File 'lib/rom/factory/builder.rb', line 12 def attributes @attributes end |
#tuple_evaluator ⇒ 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.
15 16 17 |
# File 'lib/rom/factory/builder.rb', line 15 def tuple_evaluator @tuple_evaluator end |
Instance Method Details
#persistable ⇒ 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.
35 36 37 |
# File 'lib/rom/factory/builder.rb', line 35 def persistable Persistable.new(self) end |
#relation ⇒ 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.
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 |