Class: CSstats::Parser::Reader::Players
- Inherits:
-
Object
- Object
- CSstats::Parser::Reader::Players
- Defined in:
- lib/csstats/parser/reader/players.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#max_players ⇒ Object
readonly
Returns the value of attribute max_players.
Instance Method Summary collapse
-
#initialize(file_path, options = {}) ⇒ Players
constructor
A new instance of Players.
- #parse ⇒ Object
Constructor Details
#initialize(file_path, options = {}) ⇒ Players
Returns a new instance of Players.
9 10 11 12 |
# File 'lib/csstats/parser/reader/players.rb', line 9 def initialize(file_path, = {}) @file_path = file_path @max_players = [:max_players] || 0 end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
7 8 9 |
# File 'lib/csstats/parser/reader/players.rb', line 7 def file_path @file_path end |
#max_players ⇒ Object (readonly)
Returns the value of attribute max_players.
7 8 9 |
# File 'lib/csstats/parser/reader/players.rb', line 7 def max_players @max_players end |
Instance Method Details
#parse ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/csstats/parser/reader/players.rb', line 14 def parse players = [] file_reader.read do |streamer, index| parse_player(streamer, index, players) end players end |