Class: Mongoid::Atomic::Paths::Root
- Inherits:
-
Object
- Object
- Mongoid::Atomic::Paths::Root
- Defined in:
- build/mongoid-6.1/lib/mongoid/atomic/paths/root.rb
Overview
This class encapsulates behaviour for locating and updating root documents atomically.
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
Instance Method Summary collapse
-
#initialize(document) ⇒ Root
constructor
Create the new root path utility.
-
#insert_modifier ⇒ Object
Asking for the insert modifier on a document with a root path indicates a mixed relation most likely happened.
Constructor Details
#initialize(document) ⇒ Root
Create the new root path utility.
20 21 22 |
# File 'build/mongoid-6.1/lib/mongoid/atomic/paths/root.rb', line 20 def initialize(document) @document, @path, @position = document, "", "" end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
10 11 12 |
# File 'build/mongoid-6.1/lib/mongoid/atomic/paths/root.rb', line 10 def document @document end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'build/mongoid-6.1/lib/mongoid/atomic/paths/root.rb', line 10 def path @path end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
10 11 12 |
# File 'build/mongoid-6.1/lib/mongoid/atomic/paths/root.rb', line 10 def position @position end |
Instance Method Details
#insert_modifier ⇒ Object
Asking for the insert modifier on a document with a root path indicates a mixed relation most likely happened.
33 34 35 |
# File 'build/mongoid-6.1/lib/mongoid/atomic/paths/root.rb', line 33 def insert_modifier raise Errors::InvalidPath.new(document.class) end |