123456789_123456789_123456789_123456789_123456789_

Class: ActiveSupport::Callbacks::CallTemplate::ObjectCall

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: activesupport/lib/active_support/callbacks.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(target, method) ⇒ ObjectCall

[ GitHub ]

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

def initialize(target, method)
  @override_target = target
  @method_name = method
end

Instance Method Details

#expand(target, value, block)

[ GitHub ]

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

def expand(target, value, block)
  [@override_target || target, block, @method_name, target]
end

#inverted_lambda

[ GitHub ]

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

def inverted_lambda
  lambda do |target, value, &block|
    !(@override_target || target).send(@method_name, target, &block)
  end
end

#make_lambda

[ GitHub ]

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

def make_lambda
  lambda do |target, value, &block|
    (@override_target || target).send(@method_name, target, &block)
  end
end