diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-21 14:48:09 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-21 14:48:09 -0700 |
commit | 7f94ea0c30bee85c0eecbd4ccb4c8e7efb3889bb (patch) | |
tree | c3520d0727314bff2dbfac006743672f825f605d /core/store.rb | |
parent | 211018e2f94c60fdf7a47b87cbcb07432f0fa25d (diff) | |
download | dinobot-7f94ea0c30bee85c0eecbd4ccb4c8e7efb3889bb.tar.gz dinobot-7f94ea0c30bee85c0eecbd4ccb4c8e7efb3889bb.tar.xz |
Add simple getter/setter methods to Store.
Diffstat (limited to 'core/store.rb')
-rw-r--r-- | core/store.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/store.rb b/core/store.rb index ba49733..5e1cf67 100644 --- a/core/store.rb +++ b/core/store.rb @@ -14,6 +14,14 @@ module Dinobot @data ||= Hash.new end + def [](key) + @data[key] + end + + def []=(key, value) + @data[key] = value + end + def read @store.transaction(true) do @data = @store[:data] |