Sha256: ffc47b13dcf63abd4546c6ab54c1ec06e8ed14585603d8ac6d745c0a94cb5bdf

Contents?: true

Size: 517 Bytes

Versions: 2

Compression:

Stored size: 517 Bytes

Contents

require 'active_support/deprecation'

module Protobuf
  class Deprecation < ::ActiveSupport::Deprecation
    def deprecate_methods(*args)
      args.last.merge!(:deprecator => self) if args.last.is_a?(Hash)
      super
    end

    def define_deprecated_methods(target_module, method_hash)
      target_module.module_eval do
        method_hash.each do |old_method, new_method|
          alias_method old_method, new_method
        end
      end

      deprecate_methods(target_module, method_hash)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
protobuf-3.4.1 lib/protobuf/deprecation.rb
protobuf-3.4.0 lib/protobuf/deprecation.rb