Class: BotMob::Roster
- Inherits:
-
Object
- Object
- BotMob::Roster
- Defined in:
- lib/bot_mob/roster.rb
Overview
## BotMob::Roster
This manages the pool of bots made available by the application
Instance Attribute Summary collapse
-
#bots ⇒ Object
readonly
Returns the value of attribute bots.
Instance Method Summary collapse
-
#initialize ⇒ Roster
constructor
A new instance of Roster.
- #register(bot, **_options) ⇒ Object
Constructor Details
#initialize ⇒ Roster
Returns a new instance of Roster.
9 10 11 |
# File 'lib/bot_mob/roster.rb', line 9 def initialize @bots = [] end |
Instance Attribute Details
#bots ⇒ Object (readonly)
Returns the value of attribute bots.
7 8 9 |
# File 'lib/bot_mob/roster.rb', line 7 def bots @bots end |
Instance Method Details
#register(bot, **_options) ⇒ Object
13 14 15 |
# File 'lib/bot_mob/roster.rb', line 13 def register(bot, **) @bots << (bot.is_a?(Class) ? bot.new : bot) end |