Array
# File lib/active_support/callbacks.rb, line 113 def delete(callback) super(callback.is_a?(Callback) ? callback : find(callback)) end
# File lib/active_support/callbacks.rb, line 109 def find(callback, &block) select { |c| c == callback && (!block_given? || yield(c)) }.first end
TODO: Decompose into more Array like behavior
# File lib/active_support/callbacks.rb, line 100 def replace_or_append!(chain) if index = index(chain) self[index] = chain else self << chain end self end
# File 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
Generated with the Darkfish Rdoc Generator 2.