instance method
run
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
run(object, options = {}, &terminator)
No documentation comment.
Parameters
-
objectreq -
optionsopt = {} -
terminatorblock
Source
# File activesupport/lib/active_support/callbacks.rb, line 86
def run(object, options = {}, &terminator)
enumerator = options[:enumerator] || :each
unless block_given?
send(enumerator) { |callback| callback.call(object) }
else
send(enumerator) do |callback|
result = callback.call(object)
break result if terminator.call(result, object)
end
end
end
Defined in activesupport/lib/active_support/callbacks.rb line 86
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Callbacks::CallbackChain