Class: ActiveSupport::Callbacks::CallTemplate::InstanceExec0

Inherits:
Object
  • Object
show all
Defined in:
lib/active_support/callbacks.rb

Instance Method Summary collapse

Constructor Details

#initialize(block) ⇒ InstanceExec0

Returns a new instance of InstanceExec0.



396
397
398
# File 'lib/active_support/callbacks.rb', line 396

def initialize(block)
  @override_block = block
end

Instance Method Details

#expand(target, value, block) ⇒ Object



400
401
402
# File 'lib/active_support/callbacks.rb', line 400

def expand(target, value, block)
  [target, @override_block, :instance_exec]
end

#inverted_lambdaObject



410
411
412
413
414
# File 'lib/active_support/callbacks.rb', line 410

def inverted_lambda
  lambda do |target, value, &block|
    !target.instance_exec(&@override_block)
  end
end

#make_lambdaObject



404
405
406
407
408
# File 'lib/active_support/callbacks.rb', line 404

def make_lambda
  lambda do |target, value, &block|
    target.instance_exec(&@override_block)
  end
end