class TickingAway::TimeInfo

Public Instance Methods

on_connect(*) click to toggle source

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

# 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) click to toggle source

Check time for the timezone provided against the provided time api by asking the TickingAway Bot

# 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) click to toggle source

Return the statistic for the provided tz_info or prefix by asking the TickingAway Bot

# File lib/ticking_away/cinch/plugins/time_info.rb, line 67
def timepopularity(msg)
  msg.reply @ta_bot.stat_check(msg.params[1])
end