Class: Pipio::StatusMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/pipio/messages/status_message.rb

Overview

A message saying e.g. “Blahblah has gone away.”

Constant Summary collapse

MAP =
{
  /(.+) logged in\.$/ => 'online',
  /(.+) logged out\.$/ => 'offline',
  /(.+) has signed on\.$/ => 'online',
  /(.+) has signed off\.$/ => 'offline',
  /(.+) has gone away\.$/ => 'away',
  /(.+) is no longer away\.$/ => 'available',
  /(.+) has become idle\.$/ => 'idle',
  /(.+) is no longer idle\.$/ => 'available'
}

Instance Attribute Summary collapse

Attributes inherited from Message

#sender_alias, #sender_screen_name, #time

Instance Method Summary collapse

Constructor Details

#initialize(sender_screen_name, time, sender_alias, status) ⇒ StatusMessage

Returns a new instance of StatusMessage.



15
16
17
18
# File 'lib/pipio/messages/status_message.rb', line 15

def initialize(sender_screen_name, time, sender_alias, status)
  super(sender_screen_name, time, sender_alias)
  @status = status
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



20
21
22
# File 'lib/pipio/messages/status_message.rb', line 20

def status
  @status
end

Instance Method Details

#to_sObject



22
23
24
# File 'lib/pipio/messages/status_message.rb', line 22

def to_s
  %(<status type="#{@status}" sender="#{@sender_screen_name}" time="#{adium_formatted_time}" alias="#{@sender_alias}"/>\n)
end