Class: Ytterb::Util::DataPersistHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/ytterb/util/data_persist_helper.rb

Class Method Summary collapse

Class Method Details

.get_extensionObject



14
15
16
# File 'lib/ytterb/util/data_persist_helper.rb', line 14

def self.get_extension
  return ".mpack"
end

.load(file) ⇒ Object



10
11
12
# File 'lib/ytterb/util/data_persist_helper.rb', line 10

def self.load(file)
  File.open(file,"r") {|f| MessageUnpack.unpack(f.read()) }
end

.save(file, value) ⇒ Object



6
7
8
# File 'lib/ytterb/util/data_persist_helper.rb', line 6

def self.save(file, value)
  File.open(file,"w") {|f| f.write(value.to_msgpack) }
end