class HookItem

Attributes

method_name[W]
weight[W]

Public Class Methods

new(hook_method, weight) click to toggle source
# File lib/vimamsa/hook.rb, line 5
def initialize(hook_method, weight)
  @method_name = hook_method.to_s

  if hook_method.class == Method
    @call_func = hook_method
  elsif hook_method.class == String
    @call_func = method(hook_method)
  end
  @weight = weight
end

Public Instance Methods

call(x = nil) click to toggle source
# File lib/vimamsa/hook.rb, line 16
def call(x = nil)
  @call_func.call(x) if x != nil
  @call_func.call() if x == nil
end