Module: BootyCall::Callbacker::InstanceMethods

Defined in:
lib/booty_call/callbacker.rb

Instance Method Summary collapse

Instance Method Details

#__PRISTINE__(method_id, *args, &block) ⇒ Object



106
107
108
109
110
111
112
# File 'lib/booty_call/callbacker.rb', line 106

def __PRISTINE__(method_id, *args, &block)
  if method = self.class.pristine_cache[method_id]
    method.bind(self).call(*args, &block)
  else
    raise NoMethodError, "No method named #{method_id.inspect}"
  end
end

#run_callbacks(position, method_id, *args, &block) ⇒ Object



99
100
101
102
103
104
# File 'lib/booty_call/callbacker.rb', line 99

def run_callbacks(position, method_id, *args, &block)
  self.class.run_callbacks_for(self, position, method_id, *args, &block).tap do |result|
    # Halt method propagation if before callbacks return false
    throw(method_id, false) if position.eql?(:before) and result.eql?(false)
  end
end