Module: Mongoid::Atomic::Paths::Embedded

Included in:
Many, One
Defined in:
build/mongoid-master/lib/mongoid/atomic/paths/embedded.rb,
build/mongoid-master/lib/mongoid/atomic/paths/embedded/one.rb,
build/mongoid-master/lib/mongoid/atomic/paths/embedded/many.rb

Overview

Common functionality between the two different embedded paths.

Defined Under Namespace

Classes: Many, One

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#delete_modifierObject (readonly)

Returns the value of attribute delete_modifier.



14
15
16
# File 'build/mongoid-master/lib/mongoid/atomic/paths/embedded.rb', line 14

def delete_modifier
  @delete_modifier
end

#documentObject (readonly)

Returns the value of attribute document.



14
15
16
# File 'build/mongoid-master/lib/mongoid/atomic/paths/embedded.rb', line 14

def document
  @document
end

#insert_modifierObject (readonly)

Returns the value of attribute insert_modifier.



14
15
16
# File 'build/mongoid-master/lib/mongoid/atomic/paths/embedded.rb', line 14

def insert_modifier
  @insert_modifier
end

#parentObject (readonly)

Returns the value of attribute parent.



14
15
16
# File 'build/mongoid-master/lib/mongoid/atomic/paths/embedded.rb', line 14

def parent
  @parent
end

Instance Method Details

#pathString

Get the path to the document in the hierarchy.

Examples:

Get the path.

many.path

Returns:

  • (String)

    The path to the document.

Since:

  • 2.1.0



24
25
26
# File 'build/mongoid-master/lib/mongoid/atomic/paths/embedded.rb', line 24

def path
  @path ||= position.sub(/\.\d+\z/, "")
end