From 7f94ea0c30bee85c0eecbd4ccb4c8e7efb3889bb Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 21 Apr 2014 14:48:09 -0700 Subject: Add simple getter/setter methods to Store. --- module/admin.rb | 6 +++--- module/config.rb | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'module') diff --git a/module/admin.rb b/module/admin.rb index f26a652..957be7d 100644 --- a/module/admin.rb +++ b/module/admin.rb @@ -12,21 +12,21 @@ module Dinobot @commands << :join << :part << :quit << :load << :unload @commands << :listadmins << :listmodules << :listchannels - @admins = @store.data[:admins] + @admins = @store[:admins] @admins ||= Array.new end def add(user) @admins << user unless @admins.include?(user) - @store.data[:admins] = @admins + @store[:admins] = @admins @store.save end def remove(user) @admins.delete(user) - @store.data[:admins] = @admins + @store[:admins] = @admins @store.save end diff --git a/module/config.rb b/module/config.rb index cf71bd4..0082260 100644 --- a/module/config.rb +++ b/module/config.rb @@ -17,9 +17,9 @@ module Dinobot case args when 'trigger' - m.respond [:say, m.channel, @config.data[:trigger][:global]] + m.respond [:say, m.channel, @config[:trigger][:global]] when 'debug' - m.respond [:say, m.channel, @config.data[:debug].to_s] + m.respond [:say, m.channel, @config[:debug].to_s] end end @@ -31,15 +31,15 @@ module Dinobot case key when 'trigger' - @config.data[:trigger][:global] = val + @config[:trigger][:global] = val @config.save when 'debug' case val when 'true' - @config.data[:debug] = true + @config[:debug] = true @config.save when 'false' - @config.data[:debug] = false + @config[:debug] = false @config.save end end -- cgit v1.2.3-70-g09d2