Module: Marshal

Defined in:
lib/tagen/core/marshal.rb

Class Method Summary collapse

Class Method Details

.dump(obj, *args) ⇒ String

add support with Pa

Marshal.dump(obj, Pa(path))
dump(con, [obj], limit=-1)


23
24
25
26
27
28
29
30
31
# File 'lib/tagen/core/marshal.rb', line 23

def dump(obj, *args)
	case args[0]
	when String, Pa
		path = String===args[0] ? args[0] : args[0].p
		open(path, "wb"){|f| f.write(original_dump(con))}
	else
		original_dump con, *args
	end
end

.load(obj) ⇒ String

add support with Pa

Marshal.load(Pa(path))


12
# File 'lib/tagen/core/marshal.rb', line 12

def load(obj) original_load Pa===obj ? File.read(obj.p) : obj end

.original_dumpObject



14
# File 'lib/tagen/core/marshal.rb', line 14

alias :original_dump :dump

.original_loadObject



4
# File 'lib/tagen/core/marshal.rb', line 4

alias :original_load :load