Class: SSCBot::Clu
Overview
Chat Log + User
Instance Attribute Summary collapse
- #bots ⇒ Object readonly
- #chat_log ⇒ Object readonly
- #msg_sender ⇒ Object readonly
Instance Method Summary collapse
- #add_bot(bot_class) ⇒ Object
-
#initialize(chat_log, msg_sender) ⇒ Clu
constructor
A new instance of Clu.
Constructor Details
#initialize(chat_log, msg_sender) ⇒ Clu
Returns a new instance of Clu.
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/ssc.bot/clu.rb', line 31 def initialize(chat_log,msg_sender) super() @bots = {} @chat_log = chat_log @msg_sender = msg_sender def_delegators(:@bots,:[]) def_delegator(:@bots,:key?,:bot?) def_delegators(:@chat_log,*(@chat_log.public_methods - public_methods)) def_delegators(:@msg_sender,*(@msg_sender.public_methods - public_methods)) end |
Instance Attribute Details
#bots ⇒ Object (readonly)
27 28 29 |
# File 'lib/ssc.bot/clu.rb', line 27 def bots @bots end |
#chat_log ⇒ Object (readonly)
28 29 30 |
# File 'lib/ssc.bot/clu.rb', line 28 def chat_log @chat_log end |
#msg_sender ⇒ Object (readonly)
29 30 31 |
# File 'lib/ssc.bot/clu.rb', line 29 def msg_sender @msg_sender end |
Instance Method Details
#add_bot(bot_class) ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/ssc.bot/clu.rb', line 44 def add_bot(bot_class) bot = @bots[bot_class] if bot.nil? bot = bot_class.new(self) @bots[bot_class] = bot end return bot end |