Module: Typhoeus::Request::Marshal

Included in:
Typhoeus::Request
Defined in:
lib/typhoeus/request/marshal.rb

Overview

This module contains custom serializer.

Since:

  • 0.5.0

Instance Method Summary collapse

Instance Method Details

#marshal_dumpObject

Return the important data needed to serialize this Request, except the ‘on_complete` handler, since they cannot be marshalled.

Since:

  • 0.5.0



9
10
11
12
13
# File 'lib/typhoeus/request/marshal.rb', line 9

def marshal_dump
  (instance_variables - ['@on_complete', :@on_complete]).map do |name|
    [name, instance_variable_get(name)]
  end
end

#marshal_load(attributes) ⇒ Object

Load.

Since:

  • 0.5.0



16
17
18
# File 'lib/typhoeus/request/marshal.rb', line 16

def marshal_load(attributes)
  attributes.each { |name, value| instance_variable_set(name, value) }
end