Module: TF2ClassFactory
- Defined in:
- lib/steam/community/tf2/tf2_class_factory.rb
Overview
The TF2ClassFactory is used to created instances of TF2Class based on the XML input data
Class Method Summary collapse
-
.tf2_class(class_data) ⇒ Object
Creates a new instance of TF2Class storing the statistics for a Team Fortress 2 class with the assigned XML data.
Class Method Details
.tf2_class(class_data) ⇒ Object
Creates a new instance of TF2Class storing the statistics for a Team Fortress 2 class with the assigned XML data
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/steam/community/tf2/tf2_class_factory.rb', line 18 def self.tf2_class(class_data) case class_data.elements['className'].text when 'Engineer' then return TF2Engineer.new(class_data) when 'Medic' then return TF2Medic.new(class_data) when 'Sniper' then return TF2Sniper.new(class_data) when 'Spy' then return TF2Spy.new(class_data) else return TF2Class.new(class_data) end end |