60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# File 'lib/asset_cloud/callbacks.rb', line 60
def execute_callbacks(symbol, args)
callbacks_for(symbol).each do |callback|
result = case callback
when Symbol
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
|