Class: CSstats::Parser::Writer::Player
- Inherits:
-
Object
- Object
- CSstats::Parser::Writer::Player
- Defined in:
- lib/csstats/parser/writer/player.rb
Instance Attribute Summary collapse
-
#player ⇒ Object
readonly
Returns the value of attribute player.
-
#streamer ⇒ Object
readonly
Returns the value of attribute streamer.
Instance Method Summary collapse
-
#initialize(streamer, player) ⇒ Player
constructor
A new instance of Player.
- #write ⇒ Object
Constructor Details
#initialize(streamer, player) ⇒ Player
Returns a new instance of Player.
7 8 9 10 |
# File 'lib/csstats/parser/writer/player.rb', line 7 def initialize(streamer, player) @streamer = streamer @player = player end |
Instance Attribute Details
#player ⇒ Object (readonly)
Returns the value of attribute player.
5 6 7 |
# File 'lib/csstats/parser/writer/player.rb', line 5 def player @player end |
#streamer ⇒ Object (readonly)
Returns the value of attribute streamer.
5 6 7 |
# File 'lib/csstats/parser/writer/player.rb', line 5 def streamer @streamer end |
Instance Method Details
#write ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/csstats/parser/writer/player.rb', line 12 def write CSstats::COLUMNS.each do |column| next streamer.write_int_data(0) if column.empty? value = player.send(column[:name]) send("write_#{column[:type]}", value) end end |