Sha256: ee82525a1a0df2d418bea0ac86d5379818fd5490ee387b86e9f08cfec3a21939

Contents?: true

Size: 652 Bytes

Versions: 8

Compression:

Stored size: 652 Bytes

Contents

# encoding: utf-8
require "mongoid/atomic/paths/embedded/one"
require "mongoid/atomic/paths/embedded/many"

module Mongoid
  module Atomic
    module Paths

      # Common functionality between the two different embedded paths.
      module Embedded

        attr_reader :delete_modifier, :document, :insert_modifier, :parent

        # Get the path to the document in the hierarchy.
        #
        # @example Get the path.
        #   many.path
        #
        # @return [ String ] The path to the document.
        #
        # @since 2.1.0
        def path
          @path ||= position.sub(/\.\d+\z/, "")
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mongoid-7.0.13 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.0.12 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.0.11 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.0.10 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.0.8 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.0.7 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.0.6 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.0.5 lib/mongoid/atomic/paths/embedded.rb