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)

  • read ( Boolean ) - Whether the mail/notification has been read in the EVE client. This does not change when you get it through the API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ MailMessage

:nodoc:



1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
# File 'lib/reve/classes.rb', line 1495

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 }
  @read = elem['read'] == '1'
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



1494
1495
1496
# File 'lib/reve/classes.rb', line 1494

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



1494
1495
1496
# File 'lib/reve/classes.rb', line 1494

def name
  @name
end

#readObject (readonly)

Returns the value of attribute read.



1494
1495
1496
# File 'lib/reve/classes.rb', line 1494

def read
  @read
end

#send_dateObject (readonly)

Returns the value of attribute send_date.



1494
1495
1496
# File 'lib/reve/classes.rb', line 1494

def send_date
  @send_date
end

#sender_idObject (readonly)

Returns the value of attribute sender_id.



1494
1495
1496
# File 'lib/reve/classes.rb', line 1494

def sender_id
  @sender_id
end

#titleObject (readonly)

Returns the value of attribute title.



1494
1495
1496
# File 'lib/reve/classes.rb', line 1494

def title
  @title
end

#to_character_idsObject (readonly)

Returns the value of attribute to_character_ids.



1494
1495
1496
# File 'lib/reve/classes.rb', line 1494

def to_character_ids
  @to_character_ids
end

#to_corp_or_alliance_idObject (readonly)

Returns the value of attribute to_corp_or_alliance_id.



1494
1495
1496
# File 'lib/reve/classes.rb', line 1494

def to_corp_or_alliance_id
  @to_corp_or_alliance_id
end

#to_list_idsObject (readonly)

Returns the value of attribute to_list_ids.



1494
1495
1496
# File 'lib/reve/classes.rb', line 1494

def to_list_ids
  @to_list_ids
end