Class: ActiveSupport::Callbacks::CallTemplate::InstanceExec1

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

Instance Method Summary collapse

Constructor Details

#initialize(block) ⇒ InstanceExec1

Returns a new instance of InstanceExec1.



418
419
420
# File 'lib/active_support/callbacks.rb', line 418

def initialize(block)
  @override_block = block
end

Instance Method Details

#expand(target, value, block) ⇒ Object



422
423
424
# File 'lib/active_support/callbacks.rb', line 422

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

#inverted_lambdaObject



432
433
434
435
436
# File 'lib/active_support/callbacks.rb', line 432

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

#make_lambdaObject



426
427
428
429
430
# File 'lib/active_support/callbacks.rb', line 426

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