Sha256: 7a1c95c70a52bebc06d7d31bb38fbf19d8389e7866eb4c0e8a91b79dd9f825cd

Contents?: true

Size: 757 Bytes

Versions: 13

Compression:

Stored size: 757 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

13 entries across 13 versions & 4 rubygems

Version Path
mongoid-3.1.7 lib/mongoid/relations/marshalable.rb
mongoid-4.0.0.alpha2 lib/mongoid/relations/marshalable.rb
mongoid-4.0.0.alpha1 lib/mongoid/relations/marshalable.rb
mongoid-3.1.6 lib/mongoid/relations/marshalable.rb
sepastian-mongoid-rails4-4.0.1.alpha lib/mongoid/relations/marshalable.rb
sepastian-mongoid-rails4-4.0.0.alpha lib/mongoid/relations/marshalable.rb
mongoid-3.1.5 lib/mongoid/relations/marshalable.rb
mongoid_heroku_stable-4.0.0 lib/mongoid/relations/marshalable.rb
mongoid_rails4-4.0.0 lib/mongoid/relations/marshalable.rb
mongoid-3.1.4 lib/mongoid/relations/marshalable.rb
mongoid-3.1.3 lib/mongoid/relations/marshalable.rb
mongoid-3.1.2 lib/mongoid/relations/marshalable.rb
mongoid-3.0.23 lib/mongoid/relations/marshalable.rb