Class: TickingAway::TimeInfo
- Inherits:
-
Object
- Object
- TickingAway::TimeInfo
- Includes:
- Cinch::Plugin
- Defined in:
- lib/ticking_away/cinch/plugins/time_info.rb
Instance Method Summary collapse
-
#on_connect ⇒ Object
Instantiate bot with JSON file storage when the bot connects to the IRC server.
-
#timeat(msg) ⇒ Object
Check time for the timezone provided against the provided time api by asking the TickingAway Bot.
-
#timepopularity(msg) ⇒ Object
Return the statistic for the provided tz_info or prefix by asking the TickingAway Bot.
Instance Method Details
#on_connect ⇒ Object
Instantiate bot with JSON file storage when the bot connects to the IRC server. I’d like storage to be configurable through the Cinch configs eventually
54 55 56 57 |
# File 'lib/ticking_away/cinch/plugins/time_info.rb', line 54 def on_connect(*) @storage = TickingAway::JSONFileStorage.new @ta_bot = config[:time_api] ? TickingAway::Bot.new(storage: @storage, time_api: config[:time_api]) : TickingAway::Bot.new(storage: @storage) end |
#timeat(msg) ⇒ Object
Check time for the timezone provided against the provided time api by asking the TickingAway Bot
61 62 63 |
# File 'lib/ticking_away/cinch/plugins/time_info.rb', line 61 def timeat(msg) msg.reply @ta_bot.time_check(msg.params[1]) end |
#timepopularity(msg) ⇒ Object
Return the statistic for the provided tz_info or prefix by asking the TickingAway Bot
67 68 69 |
# File 'lib/ticking_away/cinch/plugins/time_info.rb', line 67 def timepopularity(msg) msg.reply @ta_bot.stat_check(msg.params[1]) end |