123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::ClassAttribute

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: activesupport/lib/active_support/class_attribute.rb

Class Method Summary

Class Method Details

.redefine(owner, name, value)

[ GitHub ]

  
# File 'activesupport/lib/active_support/class_attribute.rb', line 6

def redefine(owner, name, value)
  if owner.singleton_class?
    owner.redefine_method(name) { value }
    owner.send(:public, name)
  end

  owner.redefine_singleton_method(name) { value }
  owner.singleton_class.send(:public, name)

  owner.redefine_singleton_method("#{name}=") do |new_value|
    if owner.equal?(self)
      value = new_value
    else
      ::ActiveSupport::ClassAttribute.redefine(self, name, new_value)
    end
  end
  owner.singleton_class.send(:public, "#{name}=")
end