Module: Typhoeus::Request::Marshal
- Included in:
- Typhoeus::Request
- Defined in:
- lib/typhoeus/request/marshal.rb
Overview
This module contains custom serializer.
Instance Method Summary collapse
-
#marshal_dump ⇒ Object
Return the important data needed to serialize this Request, except the request callbacks and ‘hydra`, since they cannot be marshalled.
-
#marshal_load(attributes) ⇒ Object
Load.
Instance Method Details
#marshal_dump ⇒ Object
Return the important data needed to serialize this Request, except the request callbacks and ‘hydra`, since they cannot be marshalled.
9 10 11 12 13 14 |
# File 'lib/typhoeus/request/marshal.rb', line 9 def marshal_dump unmarshallable = %w(@on_complete @on_success @on_failure @on_progress @on_headers @on_body @hydra) (instance_variables - unmarshallable - unmarshallable.map(&:to_sym)).map do |name| [name, instance_variable_get(name)] end end |
#marshal_load(attributes) ⇒ Object
Load.
17 18 19 |
# File 'lib/typhoeus/request/marshal.rb', line 17 def marshal_load(attributes) attributes.each { |name, value| instance_variable_set(name, value) } end |