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

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

Instance Method Summary collapse

Constructor Details

#initialize(block) ⇒ InstanceExec0

Returns a new instance of InstanceExec0.



436
437
438
# File 'activesupport/lib/active_support/callbacks.rb', line 436

def initialize(block)
  @override_block = block
end

Instance Method Details

#expand(target, value, block) ⇒ Object



440
441
442
# File 'activesupport/lib/active_support/callbacks.rb', line 440

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

#inverted_lambdaObject



450
451
452
453
454
# File 'activesupport/lib/active_support/callbacks.rb', line 450

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

#make_lambdaObject



444
445
446
447
448
# File 'activesupport/lib/active_support/callbacks.rb', line 444

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