Class: CSstats::Parser::Players
- Inherits:
-
Object
- Object
- CSstats::Parser::Players
- Defined in:
- lib/csstats/parser/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.
6 7 8 9 |
# File 'lib/csstats/parser/players.rb', line 6 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.
4 5 6 |
# File 'lib/csstats/parser/players.rb', line 4 def file_path @file_path end |
#max_players ⇒ Object (readonly)
Returns the value of attribute max_players.
4 5 6 |
# File 'lib/csstats/parser/players.rb', line 4 def max_players @max_players end |
Instance Method Details
#parse ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/csstats/parser/players.rb', line 11 def parse players = [] file_reader.read do |handler, index| parse_player(handler, index, players) end players end |