Class: Pipio::XMLMessage

Inherits:
Message show all
Defined in:
lib/pipio/messages/xml_message.rb

Overview

Basic message with body text (as opposed to pure status messages, which have no body).

Direct Known Subclasses

AutoReplyMessage, Event

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, body) ⇒ XMLMessage

Returns a new instance of XMLMessage.



5
6
7
8
9
# File 'lib/pipio/messages/xml_message.rb', line 5

def initialize(sender_screen_name, time, sender_alias, body)
  super(sender_screen_name, time, sender_alias)
  @body = normalize(body)
  @styled_body = %(<div><span style="font-family: Helvetica; font-size: 12pt;">#{@body}</span></div>)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



11
12
13
# File 'lib/pipio/messages/xml_message.rb', line 11

def body
  @body
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/pipio/messages/xml_message.rb', line 13

def to_s
  %(<message sender="#{@sender_screen_name}" time="#{adium_formatted_time}" alias="#{@sender_alias}">#{@styled_body}</message>)
end