Class: LZRTag::Hook::Debug
- Defined in:
- lib/lzrtag/hooks/standard_hooks.rb
Instance Attribute Summary collapse
-
#eventBlacklist ⇒ Object
Returns the value of attribute eventBlacklist.
-
#eventWhitelist ⇒ Object
Returns the value of attribute eventWhitelist.
Instance Method Summary collapse
- #consume_event(evtName, data) ⇒ Object
-
#initialize ⇒ Debug
constructor
A new instance of Debug.
Methods inherited from Base
describe_option, getCBs, getOptionDescriptions, on, #on, #on_hookin, #on_hookout, #process_raw_hit
Constructor Details
#initialize ⇒ Debug
Returns a new instance of Debug.
10 11 12 13 14 15 |
# File 'lib/lzrtag/hooks/standard_hooks.rb', line 10 def initialize() super(); @eventWhitelist = Array.new(); @eventBlacklist = Array.new(); end |
Instance Attribute Details
#eventBlacklist ⇒ Object
Returns the value of attribute eventBlacklist.
8 9 10 |
# File 'lib/lzrtag/hooks/standard_hooks.rb', line 8 def eventBlacklist @eventBlacklist end |
#eventWhitelist ⇒ Object
Returns the value of attribute eventWhitelist.
7 8 9 |
# File 'lib/lzrtag/hooks/standard_hooks.rb', line 7 def eventWhitelist @eventWhitelist end |
Instance Method Details
#consume_event(evtName, data) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/lzrtag/hooks/standard_hooks.rb', line 17 def consume_event(evtName, data) super(evtName, data); return if @eventBlacklist.include? evtName unless(@eventWhitelist.empty?) return unless @eventWhitelist.include? evtName end puts "Caught event: #{evtName} with data: #{data}"; end |