Sha256: 22f79a77ba2f8fdee83c00690f70689998b8f487033040b77c1f7927d95daf87

Contents?: true

Size: 683 Bytes

Versions: 27

Compression:

Stored size: 683 Bytes

Contents

# frozen_string_literal: true
# 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

27 entries across 27 versions & 2 rubygems

Version Path
mongoid-7.3.5 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.3.4 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.1.11 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.2.6 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.3.3 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.3.2 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.2.5 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.1.10 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.1.9 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.2.4 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.3.1 lib/mongoid/atomic/paths/embedded.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/lib/mongoid/atomic/paths/embedded.rb
mongoid-7.3.0 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.2.3 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.1.8 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.2.2 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.2.1 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.1.7 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.2.0 lib/mongoid/atomic/paths/embedded.rb
mongoid-7.1.6 lib/mongoid/atomic/paths/embedded.rb