Class: EveOnline::ESI::Models::Mail

Inherits:
Base
  • Object
show all
Defined in:
lib/eve_online/esi/models/mail.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from EveOnline::ESI::Models::Base

Instance Method Details

#as_jsonObject



7
8
9
10
11
12
13
14
15
# File 'lib/eve_online/esi/models/mail.rb', line 7

def as_json
  {
    body: body,
    from_id: from_id,
    read: read,
    subject: subject,
    timestamp: timestamp
  }
end

#bodyObject



17
18
19
# File 'lib/eve_online/esi/models/mail.rb', line 17

def body
  options["body"]
end

#from_idObject



21
22
23
# File 'lib/eve_online/esi/models/mail.rb', line 21

def from_id
  options["from"]
end

#label_idsObject



39
40
41
# File 'lib/eve_online/esi/models/mail.rb', line 39

def label_ids
  options["labels"]
end

#readObject



25
26
27
# File 'lib/eve_online/esi/models/mail.rb', line 25

def read
  options["read"]
end

#recipientsObject



43
44
45
# File 'lib/eve_online/esi/models/mail.rb', line 43

def recipients
  @recipients ||= MailRecipients.new(options["recipients"]).mail_recipients
end

#subjectObject



29
30
31
# File 'lib/eve_online/esi/models/mail.rb', line 29

def subject
  options["subject"]
end

#timestampObject



33
34
35
36
37
# File 'lib/eve_online/esi/models/mail.rb', line 33

def timestamp
  timestamp = options["timestamp"]

  parse_datetime_with_timezone(timestamp) if timestamp
end