Sha256: 3739e31fb40dfb5c07cef119b85c6e6ee151e7224de0acdbb22a3768d0b6b5ca

Contents?: true

Size: 632 Bytes

Versions: 29

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

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.
        def path
          @path ||= position.sub(/\.\d+\z/, "")
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
mongoid-8.0.10 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.10 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.9 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.0.9 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.8 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.7 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.6 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.0.8 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.5 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.4 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.0.7 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.3 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.2 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.0.6 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.5.4 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.1 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.0.5 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.1.0 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.5.3 lib/mongoid/atomic/paths/embedded.rb
mongoid-8.0.4 lib/mongoid/atomic/paths/embedded.rb