Class: ActiveSupport::Callbacks::CallTemplate::InstanceExec2
- Defined in:
- activesupport/lib/active_support/callbacks.rb
Instance Method Summary collapse
- #expand(target, value, block) ⇒ Object
-
#initialize(block) ⇒ InstanceExec2
constructor
A new instance of InstanceExec2.
- #inverted_lambda ⇒ Object
- #make_lambda ⇒ Object
Constructor Details
#initialize(block) ⇒ InstanceExec2
Returns a new instance of InstanceExec2.
480 481 482 |
# File 'activesupport/lib/active_support/callbacks.rb', line 480 def initialize(block) @override_block = block end |
Instance Method Details
#expand(target, value, block) ⇒ Object
484 485 486 487 |
# File 'activesupport/lib/active_support/callbacks.rb', line 484 def (target, value, block) raise ArgumentError unless block [target, @override_block || block, :instance_exec, target, block] end |
#inverted_lambda ⇒ Object
496 497 498 499 500 501 |
# File 'activesupport/lib/active_support/callbacks.rb', line 496 def inverted_lambda lambda do |target, value, &block| raise ArgumentError unless block !target.instance_exec(target, block, &@override_block) end end |
#make_lambda ⇒ Object
489 490 491 492 493 494 |
# File 'activesupport/lib/active_support/callbacks.rb', line 489 def make_lambda lambda do |target, value, &block| raise ArgumentError unless block target.instance_exec(target, block, &@override_block) end end |