Sha256: f098dc9400e11695d1a0158c574fd2645a4ec945f036b4f3cff949de317021d1

Contents?: true

Size: 1.03 KB

Versions: 99

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require "active_support/core_ext/kernel/singleton_class"
require "active_support/core_ext/module/delegation"

module ActiveSupport
  class Deprecation
    module InstanceDelegator # :nodoc:
      def self.included(base)
        base.extend(ClassMethods)
        base.singleton_class.prepend(OverrideDelegators)
        base.public_class_method :new
      end

      module ClassMethods # :nodoc:
        def include(included_module)
          included_module.instance_methods.each { |m| method_added(m) }
          super
        end

        def method_added(method_name)
          singleton_class.delegate(method_name, to: :instance)
        end
      end

      module OverrideDelegators # :nodoc:
        def warn(message = nil, callstack = nil)
          callstack ||= caller_locations(2)
          super
        end

        def deprecation_warning(deprecated_method_name, message = nil, caller_backtrace = nil)
          caller_backtrace ||= caller_locations(2)
          super
        end
      end
    end
  end
end

Version data entries

99 entries across 90 versions & 11 rubygems

Version Path
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.6.1/lib/active_support/deprecation/instance_delegator.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.6.1/lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.6.1 lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.6 lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.5.1 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.2.8.1 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.2.8 lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.5 lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.4.8 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.2.7.1 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.2.7 lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.4.7 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.2.6.3 lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.4.6 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.2.6.2 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.2.6.1 lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.4.5 lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.4.4 lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.4.3 lib/active_support/deprecation/instance_delegator.rb
activesupport-6.0.4.2 lib/active_support/deprecation/instance_delegator.rb