Class: Mongoid::Relations::Binding
- Inherits:
-
Object
- Object
- Mongoid::Relations::Binding
- Includes:
- Threaded::Lifecycle
- Defined in:
- lib/mongoid/relations/binding.rb
Overview
Superclass for all objects that bind relations together.
Direct Known Subclasses
Mongoid::Relations::Bindings::Embedded::In, Mongoid::Relations::Bindings::Embedded::Many, Mongoid::Relations::Bindings::Embedded::One, Mongoid::Relations::Bindings::Referenced::In, Mongoid::Relations::Bindings::Referenced::Many, Mongoid::Relations::Bindings::Referenced::ManyToMany, Mongoid::Relations::Bindings::Referenced::One
Instance Attribute Summary (collapse)
-
- (Object) base
readonly
Returns the value of attribute base.
-
- (Object) metadata
readonly
Returns the value of attribute metadata.
-
- (Object) target
readonly
Returns the value of attribute target.
Instance Method Summary (collapse)
-
- (Object) binding
Execute the provided block inside a binding.
-
- (Binding) initialize(base, target, metadata)
constructor
Create the new binding.
Constructor Details
- (Binding) initialize(base, target, metadata)
Create the new binding.
21 22 23 |
# File 'lib/mongoid/relations/binding.rb', line 21 def initialize(base, target, ) @base, @target, @metadata = base, target, end |
Instance Attribute Details
- (Object) base (readonly)
Returns the value of attribute base
9 10 11 |
# File 'lib/mongoid/relations/binding.rb', line 9 def base @base end |
- (Object) metadata (readonly)
Returns the value of attribute metadata
9 10 11 |
# File 'lib/mongoid/relations/binding.rb', line 9 def @metadata end |
- (Object) target (readonly)
Returns the value of attribute target
9 10 11 |
# File 'lib/mongoid/relations/binding.rb', line 9 def target @target end |
Instance Method Details
- (Object) binding
Execute the provided block inside a binding.
35 36 37 38 39 40 41 |
# File 'lib/mongoid/relations/binding.rb', line 35 def binding unless _binding? _binding do yield(self) if block_given? end end end |