class MethodCallbacks::Definer
Attributes
method[R]
Public Class Methods
new(method)
click to toggle source
# File lib/method_callbacks/definer.rb, line 11 def initialize(method) @method = method end
Public Instance Methods
define(type, callbacks)
click to toggle source
# File lib/method_callbacks/definer.rb, line 15 def define(type, callbacks) callbacks.each do |callback| callbacks(type) << callback if !callbacks(type).include?(callback) end end
define_with_block(type, &block)
click to toggle source
# File lib/method_callbacks/definer.rb, line 21 def define_with_block(type, &block) callbacks(type) << block if !callbacks(type).include?(block) end