123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Inherits: Object
Defined in: activesupport/lib/active_support/callbacks.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(block) ⇒ InstanceExec0

[ GitHub ]

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

def initialize(block)
  @override_block = block
end

Instance Method Details

#expand(target, value, block)

[ GitHub ]

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

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

#inverted_lambda

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 452

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

#make_lambda

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 446

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