Module: Memory
Overview
A simple means of persistence This can easily be swapped out for redis, but file-based is simpler and good enough for now github.com/maccman/supermodel/blob/master/README
Constant Summary collapse
- DATABASE_PATH =
(ENV['DATABASE_PATH'] || File.('../data/memory.db', $0)).freeze
Instance Method Summary collapse
Instance Method Details
#load ⇒ Object
19 20 21 |
# File 'lib/zygote/memory.rb', line 19 def load SuperModel::Marshal.load end |
#save ⇒ Object
14 15 16 17 |
# File 'lib/zygote/memory.rb', line 14 def save FileUtils.mkdir_p(File.dirname(DATABASE_PATH)) # FIXME - don't make if it already exists SuperModel::Marshal.dump end |