Class: RuboCop::Cop::Lint::DeprecatedClassMethods::Replacement
- Inherits:
-
Object
- Object
- RuboCop::Cop::Lint::DeprecatedClassMethods::Replacement
- Defined in:
- lib/rubocop/cop/lint/deprecated_class_methods.rb
Overview
Inner class to DeprecatedClassMethods. This class exists to add abstraction and clean naming to the replacements for deprecated objects
Instance Attribute Summary collapse
-
#class_constant ⇒ Object
readonly
Returns the value of attribute class_constant.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
-
#initialize(method, class_constant: nil, instance_method: false) ⇒ Replacement
constructor
A new instance of Replacement.
- #to_s ⇒ Object
Constructor Details
#initialize(method, class_constant: nil, instance_method: false) ⇒ Replacement
Returns a new instance of Replacement.
77 78 79 80 81 |
# File 'lib/rubocop/cop/lint/deprecated_class_methods.rb', line 77 def initialize(method, class_constant: nil, instance_method: false) @method = method @class_constant = class_constant @instance_method = instance_method end |
Instance Attribute Details
#class_constant ⇒ Object (readonly)
Returns the value of attribute class_constant.
75 76 77 |
# File 'lib/rubocop/cop/lint/deprecated_class_methods.rb', line 75 def class_constant @class_constant end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
75 76 77 |
# File 'lib/rubocop/cop/lint/deprecated_class_methods.rb', line 75 def method @method end |
Instance Method Details
#to_s ⇒ Object
83 84 85 |
# File 'lib/rubocop/cop/lint/deprecated_class_methods.rb', line 83 def to_s [class_constant, method].compact.join(delimiter) end |