Class: RuboCop::Cop::InSpec::Deprecations::AttributeHelper
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/inspec/deprecation/attribute_helper.rb
Overview
Chef InSpec attributes have been renamed to inputs. Use the ‘input` method not the deprecation `attribute` method to access these values.
Constant Summary collapse
- MSG =
'InSpec attributes have been renamed to inputs. Use the `input` method not the deprecation `attribute` method to access these values.'
- RESTRICT_ON_SEND =
[:attribute].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
38 39 40 41 42 |
# File 'lib/rubocop/cop/inspec/deprecation/attribute_helper.rb', line 38 def on_send(node) add_offense(node, severity: :warning) do |corrector| corrector.replace(node.loc.expression, node.loc.expression.source.gsub(/^attribute/, 'input')) end end |