class Mongoid::Atomic::Paths::Embedded::One

documents that are defined as an embedded 1-1.
This class encapsulates behavior for locating and updating

def initialize(document)

Parameters:
  • document (Document) -- The document to generate the paths for.

Other tags:
    Example: Create the path util. -
def initialize(document)
  @document, @parent = document, document._parent
  @insert_modifier, @delete_modifier ="$set", "$unset"
end

def position

Returns:
  • (String) - The position of the document.

Other tags:
    Example: Get the position. -
def position
  pos = parent.atomic_position
  "#{pos}#{"." unless pos.blank?}#{document._association.store_as}"
end