Class: EveCrest::Response::War

Inherits:
BaseResponse show all
Defined in:
lib/responses/war.rb

Instance Attribute Summary

Attributes inherited from BaseResponse

#data

Instance Method Summary collapse

Methods inherited from BaseResponse

#cached_until, #error_message, #initialize, #raw, #success?

Constructor Details

This class inherits a constructor from EveCrest::BaseResponse

Instance Method Details

#aggressor_idObject



13
14
15
# File 'lib/responses/war.rb', line 13

def aggressor_id
  data['aggressor']['id']
end

#aggressor_killsObject



19
20
21
# File 'lib/responses/war.rb', line 19

def aggressor_kills
  data['aggressor']['shipsKilled']
end

#aggressor_kills_iskObject



22
23
24
# File 'lib/responses/war.rb', line 22

def aggressor_kills_isk
  data['aggressor']['iskKilled']
end

#aggressor_nameObject



16
17
18
# File 'lib/responses/war.rb', line 16

def aggressor_name
  data['aggressor']['name']
end

#alliesObject



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/responses/war.rb', line 43

def allies
  _allies = Array.new
  if data['allies'].nil?
    _allies
  else
    data['allies'].each do |a|
      _allies.push(a['id'])
    end
    _allies
  end
end

#ally_countObject



40
41
42
# File 'lib/responses/war.rb', line 40

def ally_count
  data['allyCount']
end

#declaredObject



7
8
9
# File 'lib/responses/war.rb', line 7

def declared
  DateTime.parse(data['timeDeclared'])
end

#defender_idObject



25
26
27
# File 'lib/responses/war.rb', line 25

def defender_id
  data['defender']['id']
end

#defender_killsObject



31
32
33
# File 'lib/responses/war.rb', line 31

def defender_kills
  data['defender']['shipsKilled']
end

#defender_kills_iskObject



34
35
36
# File 'lib/responses/war.rb', line 34

def defender_kills_isk
  data['defender']['iskKilled']
end

#defender_nameObject



28
29
30
# File 'lib/responses/war.rb', line 28

def defender_name
  data['defender']['name']
end

#finishedObject



10
11
12
# File 'lib/responses/war.rb', line 10

def finished
  DateTime.parse(data['timeFinished'])
end

#is_mutual?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/responses/war.rb', line 54

def is_mutual?
  data['mutual']
end

#open_for_allies?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/responses/war.rb', line 37

def open_for_allies?
  data['openForAllies']
end

#startedObject



4
5
6
# File 'lib/responses/war.rb', line 4

def started
  DateTime.parse(data['timeStarted'])
end