module ODBA::Marshal
Marshal
is a simple extension of ::Marshal. To be able to store our data using the DBI-Interface, we need to escape invalid characters from the standard binary dump.
Public Class Methods
Source
# File lib/odba/marshal.rb, line 9 def Marshal.dump(obj) binary = ::Marshal.dump(obj) binary.unpack('H*').first end
Source
# File lib/odba/marshal.rb, line 13 def Marshal.load(hexdump) binary = [hexdump].pack('H*') ::Marshal.load(binary) rescue => error $stderr.puts "#{error}: hexdump is #{hexdump.inspect} #{error.backtrace.join("\n")}" Date.new end