37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/asset_cloud/callbacks.rb', line 37
def execute_callbacks(symbol, args)
callbacks_for(symbol).each do |callback|
result = case callback
when Symbol
self.send(callback, *args)
when Proc, Method
callback.call(self, *args)
else
if callback.respond_to?(method)
callback.send(method, self, *args)
else
raise StandardError, "Callbacks must be a symbol denoting the method to call, a string to be evaluated, a block to be invoked, or an object responding to the callback method."
end
end
return false if result == false
end
true
end
|