Class: BotMob::Roster

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeRoster

Returns a new instance of Roster.



9
10
11
# File 'lib/bot_mob/roster.rb', line 9

def initialize
  @bots = []
end

Instance Attribute Details

#botsObject (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, **_options)
  @bots << (bot.is_a?(Class) ? bot.new : bot)
end