Class: ActiveSupport::Callbacks::CallTemplate::InstanceExec2
Relationships & Source Files | |
Inherits: | Object |
Defined in: | activesupport/lib/active_support/callbacks.rb |
Class Method Summary
- .new(block) ⇒ InstanceExec2 constructor
Instance Method Summary
Constructor Details
.new(block) ⇒ InstanceExec2
# File 'activesupport/lib/active_support/callbacks.rb', line 482
def initialize(block) @override_block = block end
Instance Method Details
#expand(target, value, block)
# File 'activesupport/lib/active_support/callbacks.rb', line 486
def (target, value, block) raise ArgumentError unless block [target, @override_block || block, :instance_exec, target, block] end
#inverted_lambda
[ GitHub ]# File 'activesupport/lib/active_support/callbacks.rb', line 498
def inverted_lambda lambda do |target, value, &block| raise ArgumentError unless block !target.instance_exec(target, block, &@override_block) end end
#make_lambda
[ GitHub ]# File 'activesupport/lib/active_support/callbacks.rb', line 491
def make_lambda lambda do |target, value, &block| raise ArgumentError unless block target.instance_exec(target, block, &@override_block) end end