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.
79 80 81 82 83 |
# 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 |
Instance Attribute Details
#class_constant ⇒ Object (readonly)
Returns the value of attribute class_constant.
77 78 79 |
# File 'lib/rubocop/cop/lint/deprecated_class_methods.rb', line 77 def class_constant @class_constant end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
77 78 79 |
# File 'lib/rubocop/cop/lint/deprecated_class_methods.rb', line 77 def method @method end |
Instance Method Details
#to_s ⇒ Object
85 86 87 |
# File 'lib/rubocop/cop/lint/deprecated_class_methods.rb', line 85 def to_s [class_constant, method].compact.join(delimiter) end |