Class: Quaker3::Parser
- Inherits:
-
Object
- Object
- Quaker3::Parser
- Defined in:
- lib/quaker3/parser.rb
Overview
Converts the Quake 3 Arena log file into Game model
Constant Summary collapse
- REGEX_COMMAND =
/^.{0,7}([a-z A-Z][^:]*)/.freeze
- COMMAND_INIT_GAME =
'initgame'
- COMMAND_SHUTDOWN =
'shutdowngame'
- COMMAND_KILL =
'kill'
Instance Attribute Summary collapse
-
#games ⇒ Game
readonly
List of Game model parsed from Quake 3 Arena Server log file.
Instance Method Summary collapse
-
#initialize(file_path) ⇒ Parser
constructor
Initialize method to generate a list of games from Quake 3 Arena Server log file.
Constructor Details
#initialize(file_path) ⇒ Parser
Initialize method to generate a list of games from Quake 3 Arena Server log file
20 21 22 23 24 |
# File 'lib/quaker3/parser.rb', line 20 def initialize(file_path) @games = [] @current_game = nil process file_path end |
Instance Attribute Details
#games ⇒ Game (readonly)
List of Game model parsed from Quake 3 Arena Server log file
11 12 13 |
# File 'lib/quaker3/parser.rb', line 11 def games @games end |