Class: DoDSClass

Inherits:
Object
  • Object
show all
Includes:
GameClass
Defined in:
lib/steam/community/dods/dods_class.rb

Overview

Represents the stats for a DoD:S class for a specific user

Instance Attribute Summary collapse

Attributes included from GameClass

#play_time

Instance Method Summary collapse

Constructor Details

#initialize(class_data) ⇒ DoDSClass

Creates a new instance of DoDSClass based on the assigned XML data



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/steam/community/dods/dods_class.rb', line 18

def initialize(class_data)
  @blocks        = class_data.elements['blocks'].text.to_i
  @bombs_defused = class_data.elements['bombsdefused'].text.to_i
  @bombs_planted = class_data.elements['bombsplanted'].text.to_i
  @captures      = class_data.elements['captures'].text.to_i
  @deaths        = class_data.elements['deaths'].text.to_i
  @dominations   = class_data.elements['dominations'].text.to_i
  @key           = class_data.attributes['key']
  @kills         = class_data.elements['kills'].text.to_i
  @name          = class_data.elements["name"].text
  @play_time     = class_data.elements["playtime"].text.to_i
  @rounds_lost   = class_data.elements['roundslost'].text.to_i
  @rounds_won    = class_data.elements['roundswon'].text.to_i
  @revenges      = class_data.elements['revenges'].text.to_i
end

Instance Attribute Details

#blocksObject (readonly)

Returns the value of attribute blocks.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def blocks
  @blocks
end

#bombs_defusedObject (readonly)

Returns the value of attribute bombs_defused.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def bombs_defused
  @bombs_defused
end

#bombs_plantedObject (readonly)

Returns the value of attribute bombs_planted.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def bombs_planted
  @bombs_planted
end

#capturesObject (readonly)

Returns the value of attribute captures.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def captures
  @captures
end

#deathsObject (readonly)

Returns the value of attribute deaths.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def deaths
  @deaths
end

#dominationsObject (readonly)

Returns the value of attribute dominations.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def dominations
  @dominations
end

#keyObject (readonly)

Returns the value of attribute key.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def key
  @key
end

#killsObject (readonly)

Returns the value of attribute kills.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def kills
  @kills
end

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def name
  @name
end

#revengesObject (readonly)

Returns the value of attribute revenges.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def revenges
  @revenges
end

#rounds_lostObject (readonly)

Returns the value of attribute rounds_lost.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def rounds_lost
  @rounds_lost
end

#rounds_wonObject (readonly)

Returns the value of attribute rounds_won.



13
14
15
# File 'lib/steam/community/dods/dods_class.rb', line 13

def rounds_won
  @rounds_won
end