Module: Fargo::Supports::Chat
Instance Method Summary collapse
Instance Method Details
#messages ⇒ Object
10 11 12 |
# File 'lib/fargo/supports/chat.rb', line 10 def @public_chats end |
#messages_with(nick) ⇒ Object
14 15 16 |
# File 'lib/fargo/supports/chat.rb', line 14 def nick @chats[nick] if @chats end |
#subscribe_to_chats ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/fargo/supports/chat.rb', line 18 def subscribe_to_chats @public_chats = [] @chats = Hash.new{ |h, k| h[k] = [] } subscribe do |type, map| if type == :chat @public_chats << map elsif type == :privmsg @chats[map[:from]] << map elsif type == :hub_disconnected @chats.clear @public_chats.clear end end end |