summaryrefslogtreecommitdiffstats
path: root/lib/evendoors
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-13 00:14:00 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-13 00:14:00 +0200
commit78ec406e4ed3edc01591fecd419784e7898c6eec (patch)
treeba63956d6e125c74a70d5352393736fdf478a12f /lib/evendoors
parent151c9604a25be7c2f1e2f2818f927e17bcd3f22f (diff)
downloadedoors-ruby-78ec406e4ed3edc01591fecd419784e7898c6eec.zip
edoors-ruby-78ec406e4ed3edc01591fecd419784e7898c6eec.tar.gz
Spin: add #resume!
Diffstat (limited to 'lib/evendoors')
-rw-r--r--lib/evendoors/spin.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/evendoors/spin.rb b/lib/evendoors/spin.rb
index e4f61cf..da340d3 100644
--- a/lib/evendoors/spin.rb
+++ b/lib/evendoors/spin.rb
@@ -135,6 +135,10 @@ module EvenDoors
File.open(path||@hibernate_path,'w') do |f| f << JSON.pretty_generate(self) end
end
#
+ def self.resume! path=nil
+ self.json_create JSON.load File.open(path||@hibernate_path,'r') { |f| f.read }
+ end
+ #
end
#
end