Class: Botkit::Runner
- Inherits:
-
Object
- Object
- Botkit::Runner
- Defined in:
- lib/botkit/runner.rb
Instance Attribute Summary collapse
-
#bot ⇒ Object
readonly
Returns the value of attribute bot.
-
#polling ⇒ Object
readonly
Returns the value of attribute polling.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(bot, polling: 1) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(bot, polling: 1) ⇒ Runner
Returns a new instance of Runner.
7 8 9 10 |
# File 'lib/botkit/runner.rb', line 7 def initialize(bot, polling: 1) @bot = bot @polling = polling end |
Instance Attribute Details
#bot ⇒ Object (readonly)
Returns the value of attribute bot.
5 6 7 |
# File 'lib/botkit/runner.rb', line 5 def bot @bot end |
#polling ⇒ Object (readonly)
Returns the value of attribute polling.
5 6 7 |
# File 'lib/botkit/runner.rb', line 5 def polling @polling end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/botkit/runner.rb', line 12 def call loop do tick break if bot.halt? sleep(polling) end end |