Class: EasyHook::HookTimer::Timer
- Inherits:
-
Object
- Object
- EasyHook::HookTimer::Timer
- Defined in:
- lib/easy-hook.rb
Class Attribute Summary collapse
-
.ids ⇒ Object
Returns the value of attribute ids.
Instance Attribute Summary collapse
-
#start ⇒ Object
Returns the value of attribute start.
-
#time ⇒ Object
Returns the value of attribute time.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Timer
constructor
A new instance of Timer.
Constructor Details
Class Attribute Details
.ids ⇒ Object
Returns the value of attribute ids.
8 9 10 |
# File 'lib/easy-hook.rb', line 8 def ids @ids end |
Instance Attribute Details
#start ⇒ Object
Returns the value of attribute start.
23 24 25 |
# File 'lib/easy-hook.rb', line 23 def start @start end |
#time ⇒ Object
Returns the value of attribute time.
23 24 25 |
# File 'lib/easy-hook.rb', line 23 def time @time end |
Class Method Details
.finalize(id) ⇒ Object
10 11 12 |
# File 'lib/easy-hook.rb', line 10 def finalize(id) @ids.delete(id) end |
.register(obj) ⇒ Object
14 15 16 17 18 |
# File 'lib/easy-hook.rb', line 14 def register(obj) @ids ||= Set.new @ids << obj.object_id ObjectSpace.define_finalizer(obj, method(:finalize)) end |