module FileMarshal

Constants

VERSION

Public Class Methods

dump(file) click to toggle source
# File lib/file_marshal/facade.rb, line 2
def self.dump(file)
  hash = FileMarshal::Dumper.new(file).to_hash
  hash.to_json
end
load(string, path=nil) click to toggle source
# File lib/file_marshal/facade.rb, line 7
def self.load(string, path=nil)
  hash = JSON.parse(string)
  loader = FileMarshal::Loader.new(hash)
  path ? loader.to_file(path) : loader.tempfile
end