Class: CSstats::Writer::Players
- Inherits:
-
Object
- Object
- CSstats::Writer::Players
- Defined in:
- lib/csstats/writer/players.rb
Instance Attribute Summary collapse
-
#players ⇒ Object
readonly
Returns the value of attribute players.
Instance Method Summary collapse
-
#initialize(players) ⇒ Players
constructor
A new instance of Players.
- #write(file_path) ⇒ Object
Constructor Details
#initialize(players) ⇒ Players
6 7 8 |
# File 'lib/csstats/writer/players.rb', line 6 def initialize(players) @players = players end |
Instance Attribute Details
#players ⇒ Object (readonly)
Returns the value of attribute players.
4 5 6 |
# File 'lib/csstats/writer/players.rb', line 4 def players @players end |
Instance Method Details
#write(file_path) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/csstats/writer/players.rb', line 10 def write(file_path) file = File.new(file_path, 'w') handler = CSstats::Writer::FileWriter::Handler.new(file) handler.write_short_data(11) # File version players.each do |player| CSstats::Writer::Player.new(player).write(handler) end file.close end |