class RuboCop::Cop::Lint::DeprecatedClassMethods::Replacement

Inner class to DeprecatedClassMethods. This class exists to add abstraction and clean naming to the replacements for deprecated objects

Attributes

class_constant[R]
method[R]

Public Class Methods

new(method, class_constant: nil, instance_method: false) click to toggle source
# File lib/rubocop/cop/lint/deprecated_class_methods.rb, line 79
def initialize(method, class_constant: nil, instance_method: false)
  @method = method
  @class_constant = class_constant
  @instance_method = instance_method
end

Public Instance Methods

to_s() click to toggle source
# File lib/rubocop/cop/lint/deprecated_class_methods.rb, line 85
def to_s
  [class_constant, method].compact.join(delimiter)
end

Private Instance Methods

delimiter() click to toggle source
# File lib/rubocop/cop/lint/deprecated_class_methods.rb, line 91
def delimiter
  instance_method? ? INSTANCE_METHOD_DELIMITER : CLASS_METHOD_DELIMITER
end
instance_method?() click to toggle source
# File lib/rubocop/cop/lint/deprecated_class_methods.rb, line 95
def instance_method?
  @instance_method
end