class Hook
$hook.register(:puts,“puts”) $hook.call(:puts,“AAAA”)
Public Class Methods
new()
click to toggle source
attr_reader :pos, attr_writer :call_func
# File lib/vimamsa/hook.rb, line 30 def initialize() end
Public Instance Methods
call(hook_id, x = nil)
click to toggle source
# 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
register(hook_id, hook_method, weight = 0)
click to toggle source
# File lib/vimamsa/hook.rb, line 33 def register(hook_id, hook_method, weight = 0) self[hook_id] = [] if self[hook_id] == nil self[hook_id] << HookItem.new(hook_method, weight) end