Class: Greeve::Character::MailMessages

Inherits:
BaseItem
  • Object
show all
Defined in:
lib/greeve/character/mail_messages.rb

Overview

The header of eve mail messages sent to the character.

Attributes collapse

Instance Method Summary collapse

Methods inherited from BaseItem

attribute, #cache_expired?, #cached_until, endpoint, #inspect, namespace, #refresh, rowset, #to_s

Methods included from Helpers::AttributeToHash

#to_h

Constructor Details

#initialize(character_id, opts = {}) ⇒ MailMessages

Returns a new instance of MailMessages

Parameters:

  • character_id (Integer)

    EVE character ID



23
24
25
26
# File 'lib/greeve/character/mail_messages.rb', line 23

def initialize(character_id, opts = {})
  opts[:query_params] = { "characterID" => character_id }
  super(opts)
end

Instance Method Details

#messagesGreeve::Rowset

Parameters:

  • message_id (Integer)
  • sender_id (Integer)
  • sender_name (String)
  • sent_date (Time)
  • title (String)
  • to_corp_or_alliance_id (Integer)
  • to_character_ids
  • to_list_id (Integer)

Returns:



11
12
13
14
15
16
17
18
19
20
# File 'lib/greeve/character/mail_messages.rb', line 11

rowset :messages, xpath: "eveapi/result/rowset[@name='messages']" do
  attribute :message_id,             xpath: "@messageID",          type: :integer
  attribute :sender_id,              xpath: "@senderID",           type: :integer
  attribute :sender_name,            xpath: "@senderName",         type: :string
  attribute :sent_date,              xpath: "@sentDate",           type: :datetime
  attribute :title,                  xpath: "@title",              type: :string
  attribute :to_corp_or_alliance_id, xpath: "@toCorpOrAllianceID", type: :integer
  attribute :to_character_ids,       xpath: "@toCharacterIDs",     type: :integer_array
  attribute :to_list_id,             xpath: "@toListID",           type: :integer
end