Class: Reve::Classes::MailMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/reve/classes.rb

Overview

Represents a MailMessage for Reve::API#personal_mail_messages Attributes

  • id ( Fixnum ) - The unique message ID number.

  • sender_id ( Fixnum ) - The character ID of the message originator. (use Reve::API#character_name to get their names)

  • send_date ( Time ) - The date the message was sent.

  • title ( String ) - The title of the message

  • to_corp_or_alliance_id ( Fixnum ) - The ID of a corporation/alliance that the message was sent to.

  • to_character_ids ( [Fixnum] ) - Array of character IDs of the characters that received the message.

  • to_list_ids ( [Fixnum] ) - Array of mailing lists that the mail was sent to. (use Reve::API#personal_mailing_lists to get their names)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ MailMessage

:nodoc:



1547
1548
1549
1550
1551
1552
1553
1554
1555
# File 'lib/reve/classes.rb', line 1547

def initialize(elem) #:nodoc:
  @id = elem['messageID'].to_i
  @sender_id = elem['senderID'].to_i
  @send_date = elem['sentDate'].to_time
  @title = elem['title']
  @to_corp_or_alliance_id = elem['toCorpOrAllianceID'] == '' ? nil : elem['toCorpOrAllianceID'].to_i
  @to_character_ids = elem['toCharacterIDs'] == '' ? nil : elem['toCharacterIDs'].split(',').collect {|id| id.to_i }
  @to_list_ids = elem['toListID'] == '' ? nil : elem['toListID'].split(',').collect {|id| id.to_i }
end

Instance Attribute Details

#bodyObject

Getting the text of a mail message requires a separate Eve API call Done in Reve::API#personal_mail_bodies



1546
1547
1548
# File 'lib/reve/classes.rb', line 1546

def body
  @body
end

#idObject (readonly)

Returns the value of attribute id.



1543
1544
1545
# File 'lib/reve/classes.rb', line 1543

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



1543
1544
1545
# File 'lib/reve/classes.rb', line 1543

def name
  @name
end

#send_dateObject (readonly)

Returns the value of attribute send_date.



1543
1544
1545
# File 'lib/reve/classes.rb', line 1543

def send_date
  @send_date
end

#sender_idObject (readonly)

Returns the value of attribute sender_id.



1543
1544
1545
# File 'lib/reve/classes.rb', line 1543

def sender_id
  @sender_id
end

#titleObject (readonly)

Returns the value of attribute title.



1543
1544
1545
# File 'lib/reve/classes.rb', line 1543

def title
  @title
end

#to_character_idsObject (readonly)

Returns the value of attribute to_character_ids.



1543
1544
1545
# File 'lib/reve/classes.rb', line 1543

def to_character_ids
  @to_character_ids
end

#to_corp_or_alliance_idObject (readonly)

Returns the value of attribute to_corp_or_alliance_id.



1543
1544
1545
# File 'lib/reve/classes.rb', line 1543

def to_corp_or_alliance_id
  @to_corp_or_alliance_id
end

#to_list_idsObject (readonly)

Returns the value of attribute to_list_ids.



1543
1544
1545
# File 'lib/reve/classes.rb', line 1543

def to_list_ids
  @to_list_ids
end