Class: TimePlugin
- Inherits:
-
Campfire::PollingBot::Plugin
- Object
- Campfire::PollingBot::Plugin
- TimePlugin
- Defined in:
- lib/campfire/polling_bot/plugins/time/time_plugin.rb
Overview
Simple sample plugin to just give the current time
Constant Summary
Constants inherited from Campfire::PollingBot::Plugin
Campfire::PollingBot::Plugin::HALT
Instance Attribute Summary
Attributes inherited from Campfire::PollingBot::Plugin
Instance Method Summary collapse
-
#help ⇒ Object
return array of available commands and descriptions.
- #process(message) ⇒ Object
Methods inherited from Campfire::PollingBot::Plugin
accepts, #accepts?, accepts?, bot, bot=, directory, directory=, inherited, #initialize, load_all, load_plugin_classes, #logger, logger, priority, #priority, requires_config, requires_config?, #requires_config?, setup_database, subclasses, #to_s
Constructor Details
This class inherits a constructor from Campfire::PollingBot::Plugin
Instance Method Details
#help ⇒ Object
return array of available commands and descriptions
14 15 16 |
# File 'lib/campfire/polling_bot/plugins/time/time_plugin.rb', line 14 def help [['time', "say the current time"]] end |
#process(message) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/campfire/polling_bot/plugins/time/time_plugin.rb', line 5 def process() case .command when /time/i bot.say("#{.person}, the time is #{Time.now}") return HALT end end |