Module: Marshal
- Defined in:
- lib/pa/ext.rb
Overview
add Pa support in Marshal
Class Method Summary collapse
-
.dump(obj, *args) ⇒ String
add support with Pa.
-
.load(obj) ⇒ String
add support with Pa.
- .original_dump ⇒ Object
- .original_load ⇒ Object
Class Method Details
.dump(obj, *args) ⇒ String
24 25 26 27 28 29 30 31 32 |
# File 'lib/pa/ext.rb', line 24 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
13 |
# File 'lib/pa/ext.rb', line 13 def load(obj) original_load Pa===obj ? File.read(obj.p) : obj end |
.original_dump ⇒ Object
15 |
# File 'lib/pa/ext.rb', line 15 alias :original_dump :dump |
.original_load ⇒ Object
5 |
# File 'lib/pa/ext.rb', line 5 alias :original_load :load |