Class: EventHook
Constant Summary collapse
- VERSION =
'1.1.1'
- NONE =
0x00
- LINE =
0x01
- CLASS =
0x02
- NND =
0x04
- CALL =
0x08
- RETURN =
0x10
- CCALL =
0x20
- CRETURN =
0x40
- RAISE =
0x80
- ALL =
0xff
- EVENTS =
Ruby events that EventHook notifies you about.
{ LINE => :line, CLASS => :class, NND => :end, CALL => :call, RETURN => :return, CCALL => :ccall, CRETURN => :creturn, RAISE => :raise, }
Class Method Summary collapse
-
.process(*args) ⇒ Object
Redefine me in a subclass.
- .start_hook ⇒ Object
- .stop_hook ⇒ Object
Class Method Details
.process(*args) ⇒ Object
Redefine me in a subclass. args
is [event_id, self, method, class].
45 46 47 |
# File 'lib/event_hook.rb', line 45 def self.process(*args) raise NotImplementedError, "subclass responsibility" end |
.start_hook ⇒ Object
34 35 36 |
# File 'lib/event_hook.rb', line 34 def self.start_hook self.instance.add_event_hook end |
.stop_hook ⇒ Object
38 39 40 |
# File 'lib/event_hook.rb', line 38 def self.stop_hook self.instance.remove_event_hook end |