class SmsBackupRenderer::Message
Represents an SMS or MMS message.
Attributes
date_time[R]
Returns a Time instance indicating when the message was sent or received.
outgoing[R]
Returns true if the message was sent to address, false if received from address.
participants[R]
Returns an Array of Participant
instances representing the senders and recipients of the message.
For MMS messages there may be multiple recipients. For SMS messages, the originator of the archive is never represented, so there will only be a sender (for incoming messages) or a recipient (for outgoing messages).
parts[R]
Returns an Array of MessagePart
instances representing the contents of the message.
subject[R]
Returns the String subject/title of the message, likely nil.
Public Class Methods
new(args)
click to toggle source
# File lib/sms_backup_renderer/models.rb, line 60 def initialize(args) @contact_name = args[:contact_name] @date_time = args[:date_time] @outgoing = args[:outgoing] @participants = args[:participants] @parts = args[:parts] || [] @subject = args[:subject] end
Public Instance Methods
sender()
click to toggle source
Returns the Participant
instance for the message sender, or nil.
# File lib/sms_backup_renderer/models.rb, line 70 def sender @sender ||= participants.detect(&:sender) end