From d6c6160df2e1872e1a0be9dfb8773c174ba4bde2 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 20 Apr 2014 07:08:49 -0700 Subject: Rename Module::Module to Module::Base. --- module/admin.rb | 4 ++-- module/base.rb | 25 +++++++++++++++++++++++++ module/module.rb | 25 ------------------------- module/test.rb | 4 ++-- 4 files changed, 29 insertions(+), 29 deletions(-) create mode 100644 module/base.rb delete mode 100644 module/module.rb diff --git a/module/admin.rb b/module/admin.rb index dd52cab..f700a74 100644 --- a/module/admin.rb +++ b/module/admin.rb @@ -1,8 +1,8 @@ -require_relative 'module' +require_relative 'base' module Dinobot module Module - class Admin < Module + class Admin < Base def initialize(bot) super diff --git a/module/base.rb b/module/base.rb new file mode 100644 index 0000000..b8be306 --- /dev/null +++ b/module/base.rb @@ -0,0 +1,25 @@ +module Dinobot + module Module + class Base + attr_accessor :commands + + def initialize(bot) + @bot = bot + + @commands = [:commands] + end + + def call(user, channel, message) + command, argument = message.split(' ', 3)[1..2] + + if @commands.map { |x| x.to_s }.include?(command) + send(command, user, channel, argument) + end + end + + def commands(user, channel, argument) + [[:say, channel, "Commands: #{@commands.sort.join(' ')}"]] + end + end + end +end diff --git a/module/module.rb b/module/module.rb deleted file mode 100644 index 9d72b09..0000000 --- a/module/module.rb +++ /dev/null @@ -1,25 +0,0 @@ -module Dinobot - module Module - class Module - attr_accessor :commands - - def initialize(bot) - @bot = bot - - @commands = [:commands] - end - - def call(user, channel, message) - command, argument = message.split(' ', 3)[1..2] - - if @commands.map { |x| x.to_s }.include?(command) - send(command, user, channel, argument) - end - end - - def commands(user, channel, argument) - [[:say, channel, "Commands: #{@commands.sort.join(' ')}"]] - end - end - end -end diff --git a/module/test.rb b/module/test.rb index e1d8358..f728930 100644 --- a/module/test.rb +++ b/module/test.rb @@ -1,8 +1,8 @@ -require_relative 'module' +require_relative 'base' module Dinobot module Module - class Test < Module + class Test < Base def initialize(bot) super -- cgit v1.2.3-70-g09d2