class Botkit::Runner

Attributes

bot[R]
polling[R]

Public Class Methods

new(bot, polling: 1) click to toggle source
# File lib/botkit/runner.rb, line 7
def initialize(bot, polling: 1)
  @bot = bot
  @polling = polling
end

Public Instance Methods

call() click to toggle source
# File lib/botkit/runner.rb, line 12
def call
  loop do
    tick
    break if bot.halt?
    sleep(polling)
  end
end

Private Instance Methods

tick() click to toggle source
# File lib/botkit/runner.rb, line 20
        def tick
  bot.call
rescue StandardError => exception
  bot.report_exception(exception)
end