Class: Greeve::Character::MailBodies

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

Overview

Bodies 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, *message_ids, opts = {}) ⇒ MailBodies

Returns a new instance of MailBodies

Parameters:

  • character_id (Integer)

    EVE character ID

  • message_ids (*Array<Integer>, Integer)

    either a single message ID, or a list of message IDs



21
22
23
24
25
26
27
28
29
30
# File 'lib/greeve/character/mail_bodies.rb', line 21

def initialize(character_id, *message_ids)
  opts = message_ids.last.is_a?(Hash) ? message_ids.pop : {}

  opts[:query_params] = {
    "characterID" => character_id,
    "IDs" => message_ids.join(","),
  }

  super(opts)
end

Instance Method Details

#messagesGreeve::Rowset

Parameters:

  • message_id (Integer)
  • message_text (String)

Returns:



11
12
13
14
# File 'lib/greeve/character/mail_bodies.rb', line 11

rowset :messages, xpath: "eveapi/result/rowset[@name='messages']" do
  attribute :message_id, xpath: "@messageID", type: :integer
  attribute :message_text, xpath: "?[0]", type: :string
end