Sha256: d84b5cebe240fc3557ea0105559bee3e2eabdb591b24e601efd396bb27628850

Contents?: true

Size: 765 Bytes

Versions: 53

Compression:

Stored size: 765 Bytes

Contents

# encoding: utf-8
module Mongoid
  module Relations
    module Marshalable

      # Provides the data needed to Marshal.dump a relation proxy.
      #
      # @example Dump the proxy.
      #   Marshal.dump(proxy)
      #
      # @return [ Array<Object> ] The dumped data.
      #
      # @since 3.0.15
      def marshal_dump
        [ base, target, __metadata ]
      end

      # Takes the provided data and sets it back on the proxy.
      #
      # @example Load the proxy.
      #   Marshal.load(proxy)
      #
      # @return [ Array<Object> ] The loaded data.
      #
      # @since 3.0.15
      def marshal_load(data)
        @base, @target, @__metadata = data
        extend_proxy(__metadata.extension) if __metadata.extension?
      end
    end
  end
end

Version data entries

53 entries across 48 versions & 3 rubygems

Version Path
mongoid-6.4.8 lib/mongoid/relations/marshalable.rb
mongoid-6.4.7 lib/mongoid/relations/marshalable.rb
mongoid-6.4.5 lib/mongoid/relations/marshalable.rb
mongoid-5.4.1 lib/mongoid/relations/marshalable.rb
mongoid-6.4.4 lib/mongoid/relations/marshalable.rb
mongoid-6.4.2 lib/mongoid/relations/marshalable.rb
mongoid-6.4.1 lib/mongoid/relations/marshalable.rb
mongoid-5.4.0 lib/mongoid/relations/marshalable.rb
tdiary-5.0.8 vendor/bundle/gems/mongoid-6.4.0/lib/mongoid/relations/marshalable.rb
mongoid-6.4.0 lib/mongoid/relations/marshalable.rb
mongoid-6.3.0 lib/mongoid/relations/marshalable.rb
mongoid-6.2.1 lib/mongoid/relations/marshalable.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.2.0/lib/mongoid/relations/marshalable.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mongoid-6.1.0/lib/mongoid/relations/marshalable.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.1.0/lib/mongoid/relations/marshalable.rb
mongoid-6.2.0 lib/mongoid/relations/marshalable.rb
mongoid-6.1.1 lib/mongoid/relations/marshalable.rb
mongoid-5.2.1 lib/mongoid/relations/marshalable.rb
tdiary-5.0.4 vendor/bundle/gems/mongoid-6.1.0/lib/mongoid/relations/marshalable.rb
mongoid-6.1.0 lib/mongoid/relations/marshalable.rb