class ActiveSupport::Callbacks::CallTemplate::InstanceExec2

Public Class Methods

new(block) click to toggle source
# File lib/active_support/callbacks.rb, line 479
def initialize(block)
  @override_block = block
end

Public Instance Methods

expand(target, value, block) click to toggle source
# File lib/active_support/callbacks.rb, line 483
def expand(target, value, block)
  raise ArgumentError unless block
  [target, @override_block || block, :instance_exec, target, block]
end
inverted_lambda() click to toggle source
# File lib/active_support/callbacks.rb, line 495
def inverted_lambda
  lambda do |target, value, &block|
    raise ArgumentError unless block
    !target.instance_exec(target, block, &@override_block)
  end
end
make_lambda() click to toggle source
# File lib/active_support/callbacks.rb, line 488
def make_lambda
  lambda do |target, value, &block|
    raise ArgumentError unless block
    target.instance_exec(target, block, &@override_block)
  end
end