class Mongoid::Atomic::Paths::Root

This class encapsulates behavior for locating and updating root documents atomically.

Attributes

document[R]
path[R]
position[R]

Public Class Methods

new(document) click to toggle source

Create the new root path utility.

@example Create the root path util.

Root.new(document)

@param [ Document ] document The document to generate the paths for.

@since 2.1.0

# File lib/mongoid/atomic/paths/root.rb, line 22
def initialize(document)
  @document, @path, @position = document, "", ""
end

Public Instance Methods

insert_modifier() click to toggle source

Asking for the insert modifier on a document with a root path indicates a mixed association most likely happened.

@example Attempt to get the insert modifier.

root.insert_modifier

@raise [ Errors::InvalidPath ] The error for the attempt.

@since 3.0.14

# File lib/mongoid/atomic/paths/root.rb, line 35
def insert_modifier
  raise Errors::InvalidPath.new(document.class)
end