Class: Mongoid::Relations::Builder
- Defined in:
- lib/mongoid/relations/builder.rb
Overview
Superclass for all builder objects. Builders are responsible for either looking up a relation’s target from the database, or creating them from a supplied attributes hash.
Direct Known Subclasses
Mongoid::Relations::Builders::Embedded::In, Mongoid::Relations::Builders::Embedded::Many, Mongoid::Relations::Builders::Embedded::One, Mongoid::Relations::Builders::Referenced::In, Mongoid::Relations::Builders::Referenced::Many, Mongoid::Relations::Builders::Referenced::ManyToMany, Mongoid::Relations::Builders::Referenced::One
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
-
#initialize(metadata, object) ⇒ Builder
constructor
Instantiate the new builder for a relation.
Constructor Details
#initialize(metadata, object) ⇒ Builder
Instantiate the new builder for a relation.
21 22 23 |
# File 'lib/mongoid/relations/builder.rb', line 21 def initialize(, object) @metadata, @object = , object end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
10 11 12 |
# File 'lib/mongoid/relations/builder.rb', line 10 def @metadata end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
10 11 12 |
# File 'lib/mongoid/relations/builder.rb', line 10 def object @object end |