Class: Smackr::Chat::MessageReceiver
- Inherits:
-
Object
- Object
- Smackr::Chat::MessageReceiver
- Defined in:
- lib/smackr/chat.rb
Instance Attribute Summary collapse
-
#chat ⇒ Object
Returns the value of attribute chat.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ MessageReceiver
constructor
A new instance of MessageReceiver.
- #process_message(conn, msg) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ MessageReceiver
Returns a new instance of MessageReceiver.
33 34 35 |
# File 'lib/smackr/chat.rb', line 33 def initialize(opts={}) self.chat = opts[:chat] end |
Instance Attribute Details
#chat ⇒ Object
Returns the value of attribute chat.
32 33 34 |
# File 'lib/smackr/chat.rb', line 32 def chat @chat end |
Instance Method Details
#process_message(conn, msg) ⇒ Object
36 37 38 39 |
# File 'lib/smackr/chat.rb', line 36 def (conn, msg) chat. << msg chat..call(conn, msg) if chat. end |