Class: ActiveSupport::Callbacks::CallTemplate::ProcCall
- Defined in:
- lib/active_support/callbacks.rb
Instance Method Summary collapse
- #expand(target, value, block) ⇒ Object
-
#initialize(target) ⇒ ProcCall
constructor
A new instance of ProcCall.
- #inverted_lambda ⇒ Object
- #make_lambda ⇒ Object
Constructor Details
#initialize(target) ⇒ ProcCall
Returns a new instance of ProcCall.
465 466 467 |
# File 'lib/active_support/callbacks.rb', line 465 def initialize(target) @override_target = target end |
Instance Method Details
#expand(target, value, block) ⇒ Object
469 470 471 |
# File 'lib/active_support/callbacks.rb', line 469 def (target, value, block) [@override_target || target, block, :call, target, value] end |
#inverted_lambda ⇒ Object
479 480 481 482 483 |
# File 'lib/active_support/callbacks.rb', line 479 def inverted_lambda lambda do |target, value, &block| !(@override_target || target).call(target, value, &block) end end |
#make_lambda ⇒ Object
473 474 475 476 477 |
# File 'lib/active_support/callbacks.rb', line 473 def make_lambda lambda do |target, value, &block| (@override_target || target).call(target, value, &block) end end |