Module: Mongoid::Relations::Marshalable
- Included in:
- Proxy
- Defined in:
- lib/mongoid/relations/marshalable.rb
Instance Method Summary collapse
-
#marshal_dump ⇒ Array<Object>
Provides the data needed to Marshal.dump a relation proxy.
-
#marshal_load(data) ⇒ Array<Object>
Takes the provided data and sets it back on the proxy.
Instance Method Details
#marshal_dump ⇒ Array<Object>
Provides the data needed to Marshal.dump a relation proxy.
14 15 16 |
# File 'lib/mongoid/relations/marshalable.rb', line 14 def marshal_dump [ base, target, ] end |
#marshal_load(data) ⇒ Array<Object>
Takes the provided data and sets it back on the proxy.
26 27 28 29 |
# File 'lib/mongoid/relations/marshalable.rb', line 26 def marshal_load(data) @base, @target, @metadata = data extend_proxy(.extension) if .extension? end |