Class: Protobuf::DeprecationBase

Inherits:
ActiveSupport::Deprecation
  • Object
show all
Defined in:
lib/protobuf/deprecation.rb

Direct Known Subclasses

Deprecation, FieldDeprecation

Instance Method Summary collapse

Instance Method Details

#deprecate_methods(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/protobuf/deprecation.rb', line 6

def deprecate_methods(*args)
  deprecation_options = { :deprecator => self }

  if args.last.is_a?(Hash)
    args.last.merge!(deprecation_options)
  else
    args.push(deprecation_options)
  end

  super
end

#deprecation_warning(deprecated_method_name, message = nil, caller_backtrace = nil) ⇒ Object



18
19
20
21
# File 'lib/protobuf/deprecation.rb', line 18

def deprecation_warning(deprecated_method_name, message = nil, caller_backtrace = nil)
  # This ensures ActiveSupport::Deprecation doesn't look for the caller, which is very costly.
  super(deprecated_method_name, message, caller_backtrace) unless ENV.key?('PB_IGNORE_DEPRECATIONS')
end