Sha256: 0c583706693cfd2b7195e8b5da961b83b8c41b44f7ede845f1c4ab7bfef38944
Contents?: true
Size: 711 Bytes
Versions: 12
Compression:
Stored size: 711 Bytes
Contents
# frozen_string_literal: true module ActiveSupport module ClassAttribute # :nodoc: class << self 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 end end end
Version data entries
12 entries across 12 versions & 2 rubygems