Class: SSCBot::ChatLog::Observer
- Inherits:
-
Object
- Object
- SSCBot::ChatLog::Observer
- Defined in:
- lib/ssc.bot/chat_log.rb
Overview
Instance Attribute Summary collapse
- #funcs ⇒ Object readonly
- #object ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(object, *funcs) ⇒ Observer
constructor
A new instance of Observer.
- #notify(chat_log, message) ⇒ Object
Constructor Details
#initialize(object, *funcs) ⇒ Observer
Returns a new instance of Observer.
243 244 245 246 247 248 249 250 |
# File 'lib/ssc.bot/chat_log.rb', line 243 def initialize(object,*funcs) super() raise ArgumentError,'empty funcs' if funcs.empty? @funcs = funcs @object = object end |
Instance Attribute Details
#funcs ⇒ Object (readonly)
240 241 242 |
# File 'lib/ssc.bot/chat_log.rb', line 240 def funcs @funcs end |
#object ⇒ Object (readonly)
241 242 243 |
# File 'lib/ssc.bot/chat_log.rb', line 241 def object @object end |
Instance Method Details
#notify(chat_log, message) ⇒ Object
252 253 254 255 256 |
# File 'lib/ssc.bot/chat_log.rb', line 252 def notify(chat_log,) @funcs.each do |func| @object.__send__(func,chat_log,) end end |