Class: HookItem
- Inherits:
-
Object
- Object
- HookItem
- Defined in:
- lib/vimamsa/hook.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
writeonly
Sets the attribute method_name.
-
#weight ⇒ Object
writeonly
Sets the attribute weight.
Instance Method Summary collapse
- #call(x = nil) ⇒ Object
-
#initialize(hook_method, weight) ⇒ HookItem
constructor
A new instance of HookItem.
Constructor Details
#initialize(hook_method, weight) ⇒ HookItem
Returns a new instance of HookItem.
5 6 7 8 9 10 11 12 13 14 |
# 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 |
Instance Attribute Details
#method_name=(value) ⇒ Object (writeonly)
Sets the attribute method_name
3 4 5 |
# File 'lib/vimamsa/hook.rb', line 3 def method_name=(value) @method_name = value end |
#weight=(value) ⇒ Object (writeonly)
Sets the attribute weight
3 4 5 |
# File 'lib/vimamsa/hook.rb', line 3 def weight=(value) @weight = value end |