Class: Hook
- Inherits:
-
Hash
- Object
- Hash
- Hook
- Defined in:
- lib/vimamsa/hook.rb
Overview
$hook.register(:puts,“puts”) $hook.call(:puts,“AAAA”)
Instance Method Summary collapse
- #call(hook_id, x = nil) ⇒ Object
-
#initialize ⇒ Hook
constructor
attr_reader :pos, attr_writer :call_func.
- #register(hook_id, hook_method, weight = 0) ⇒ Object
Constructor Details
#initialize ⇒ Hook
attr_reader :pos, attr_writer :call_func
30 31 |
# File 'lib/vimamsa/hook.rb', line 30 def initialize() end |
Instance Method Details
#call(hook_id, x = nil) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/vimamsa/hook.rb', line 38 def call(hook_id, x = nil) if self[hook_id] self[hook_id].each { |hi| hi.call(x) if x != nil hi.call() if x == nil } end end |