Class: DoDSClass

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

Overview

Represents the stats for a Day of Defeat: Source class for a specific user

Author:

  • Sebastian Staudt

Instance Attribute Summary collapse

Attributes included from GameClass

#name, #play_time

Instance Method Summary collapse

Constructor Details

#initialize(class_data) ⇒ DoDSClass

Creates a new instance of a Day of Defeat: Source class based on the given XML data

Parameters:

  • class_data (Hash<String, Object>)

    The XML data of the class



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/steam/community/dods/dods_class.rb', line 74

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

Instance Attribute Details

#blocksFixnum (readonly)

Returns the blocks achieved by the player with this class

Returns:

  • (Fixnum)

    The blocks achieved by the player



18
19
20
# File 'lib/steam/community/dods/dods_class.rb', line 18

def blocks
  @blocks
end

#bombs_defusedFixnum (readonly)

Returns the bombs defused by the player with this class

Returns:

  • (Fixnum)

    The bombs defused by the player



23
24
25
# File 'lib/steam/community/dods/dods_class.rb', line 23

def bombs_defused
  @bombs_defused
end

#bombs_plantedFixnum (readonly)

Returns the bombs planted by the player with this class

Returns:

  • (Fixnum)

    the bombs planted by the player



28
29
30
# File 'lib/steam/community/dods/dods_class.rb', line 28

def bombs_planted
  @bombs_planted
end

#capturesFixnum (readonly)

Returns the number of points captured by the player with this class

Returns:

  • (Fixnum)

    The number of points captured by the player



33
34
35
# File 'lib/steam/community/dods/dods_class.rb', line 33

def captures
  @captures
end

#deathsFixnum (readonly)

Returns the number of times the player died with this class

Returns:

  • (Fixnum)

    The number of deaths by the player



38
39
40
# File 'lib/steam/community/dods/dods_class.rb', line 38

def deaths
  @deaths
end

#dominationsFixnum (readonly)

Returns the dominations achieved by the player with this class

Returns:

  • (Fixnum)

    The dominations achieved by the player



43
44
45
# File 'lib/steam/community/dods/dods_class.rb', line 43

def dominations
  @dominations
end

#keyString (readonly)

Returns the ID of this class

Returns:

  • (String)

    The ID of this class



48
49
50
# File 'lib/steam/community/dods/dods_class.rb', line 48

def key
  @key
end

#killsFixnum (readonly)

Returns the number of enemies killed by the player with this class

Returns:

  • (Fixnum)

    The number of enemies killed by the player



53
54
55
# File 'lib/steam/community/dods/dods_class.rb', line 53

def kills
  @kills
end

#revengesFixnum (readonly)

Returns the revenges achieved by the player with this class

Returns:

  • (Fixnum)

    The revenges achieved by the player



63
64
65
# File 'lib/steam/community/dods/dods_class.rb', line 63

def revenges
  @revenges
end

#rounds_lostFixnum (readonly)

Returns the number of rounds lost with this class

Returns:

  • (Fixnum)

    The number of rounds lost with this class



58
59
60
# File 'lib/steam/community/dods/dods_class.rb', line 58

def rounds_lost
  @rounds_lost
end

#rounds_wonFixnum (readonly)

Returns the number of rounds won with this class

Returns:

  • (Fixnum)

    The number of rounds won with this class



68
69
70
# File 'lib/steam/community/dods/dods_class.rb', line 68

def rounds_won
  @rounds_won
end