Class: Overlook::Csgo::Demo::Parser
- Inherits:
-
Object
- Object
- Overlook::Csgo::Demo::Parser
- Includes:
- Wisper::Publisher
- Defined in:
- lib/overlook/csgo/demo/parser.rb
Constant Summary collapse
- Exception =
Class.new(StandardError)
- InvalidDemo =
Class.new(Exception)
Instance Attribute Summary collapse
-
#descriptors ⇒ Object
Returns the value of attribute descriptors.
-
#parser_config ⇒ Object
readonly
Returns the value of attribute parser_config.
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
Instance Method Summary collapse
- #emit(event, data = {}) ⇒ Object
-
#initialize(io, parser_config) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(io, parser_config) ⇒ Parser
Returns a new instance of Parser.
16 17 18 19 20 21 |
# File 'lib/overlook/csgo/demo/parser.rb', line 16 def initialize(io, parser_config) @parser_config = parser_config @reader = ByteReader.new(io) @header = nil @descriptors = {} end |
Instance Attribute Details
#descriptors ⇒ Object
Returns the value of attribute descriptors.
14 15 16 |
# File 'lib/overlook/csgo/demo/parser.rb', line 14 def descriptors @descriptors end |
#parser_config ⇒ Object (readonly)
Returns the value of attribute parser_config.
13 14 15 |
# File 'lib/overlook/csgo/demo/parser.rb', line 13 def parser_config @parser_config end |
#reader ⇒ Object (readonly)
Returns the value of attribute reader.
12 13 14 |
# File 'lib/overlook/csgo/demo/parser.rb', line 12 def reader @reader end |
Instance Method Details
#emit(event, data = {}) ⇒ Object
29 30 31 |
# File 'lib/overlook/csgo/demo/parser.rb', line 29 def emit(event, data = {}) broadcast(event.to_sym, data) end |
#parse ⇒ Object
23 24 25 26 27 |
# File 'lib/overlook/csgo/demo/parser.rb', line 23 def parse header packets done end |