Class: Pidgin2Adium::Event

Inherits:
XMLMessage show all
Defined in:
lib/pidgin2adium/messages/event.rb

Overview

Pidgin does not have Events, but Adium does. Pidgin mostly uses system messages to display what Adium calls events. These include sending a file, starting a Direct IM connection, or an error in chat.

Instance Attribute Summary collapse

Attributes inherited from XMLMessage

#body

Attributes inherited from Message

#buddy_alias, #sender, #time

Instance Method Summary collapse

Methods inherited from XMLMessage

#normalize_body!, #normalize_body_entities!

Methods inherited from Message

#<=>

Constructor Details

#initialize(sender, time, buddy_alias, body, event_type) ⇒ Event

Returns a new instance of Event.



6
7
8
9
# File 'lib/pidgin2adium/messages/event.rb', line 6

def initialize(sender, time, buddy_alias, body, event_type)
  super(sender, time, buddy_alias, body)
  @event_type = event_type
end

Instance Attribute Details

#event_typeObject

Returns the value of attribute event_type.



10
11
12
# File 'lib/pidgin2adium/messages/event.rb', line 10

def event_type
  @event_type
end

Instance Method Details

#to_sObject



12
13
14
15
# File 'lib/pidgin2adium/messages/event.rb', line 12

def to_s
  return sprintf('<event type="%s" sender="%s" time="%s" alias="%s">%s</event>',
                 @event_type, @sender, @time, @buddy_alias, @styled_body)
end