aboutsummaryrefslogtreecommitdiff
path: root/core/store.rb
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-04-21 14:48:09 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-04-21 14:48:09 -0700
commit7f94ea0c30bee85c0eecbd4ccb4c8e7efb3889bb (patch)
treec3520d0727314bff2dbfac006743672f825f605d /core/store.rb
parent211018e2f94c60fdf7a47b87cbcb07432f0fa25d (diff)
downloaddinobot-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.rb8
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]