Module: SerializableProc::Marshalable::InstanceMethods

Defined in:
lib/serializable_proc/marshalable.rb

Instance Method Summary collapse

Instance Method Details

#marshal_dumpObject



28
29
30
# File 'lib/serializable_proc/marshalable.rb', line 28

def marshal_dump
  marshalable_attrs.map{|attr| instance_variable_get(attr) }
end

#marshal_load(data) ⇒ Object



32
33
34
35
36
# File 'lib/serializable_proc/marshalable.rb', line 32

def marshal_load(data)
  [data].flatten.each_with_index do |val, i|
    instance_variable_set(marshalable_attrs[i], val)
  end
end