Methods
Class Public methods
new(method)
📝 Source code
# File activesupport/lib/active_support/callbacks.rb, line 380
def initialize(method)
@method_name = method
end
🔎 See on GitHub
Instance Public methods
expand(target, value, block)
Return the parts needed to make this call, with the given input values.
Returns an array of the form:
[target, block, method, *arguments]
This array can be used as such:
target.send(method, *arguments, &block)
The actual invocation is left up to the caller to minimize call stack pollution.
📝 Source code
# File activesupport/lib/active_support/callbacks.rb, line 397
def expand(target, value, block)
[target, block, @method_name]
end
🔎 See on GitHub
inverted_lambda()
📝 Source code
# File activesupport/lib/active_support/callbacks.rb, line 407
def inverted_lambda
lambda do |target, value, &block|
!target.send(@method_name, &block)
end
end
🔎 See on GitHub
make_lambda()
📝 Source code
# File activesupport/lib/active_support/callbacks.rb, line 401
def make_lambda
lambda do |target, value, &block|
target.send(@method_name, &block)
end
end
🔎 See on GitHub