Class: RuboCop::Cop::Chef::Modernize::SetOrReturnInResources
- Defined in:
- lib/rubocop/cop/chef/modernize/resource_set_or_return.rb
Overview
set_or_return within a method should not be used to define property in a resource. Instead use the property method which properly validates and defines properties in a way that works with reporting and documentation functionality in Chef Infra Client
Constant Summary collapse
- MSG =
'Do not use set_or_return within a method to define a property for a resource. Use the property method instead, which supports validation, reporting, and documentation functionality'
- RESTRICT_ON_SEND =
[:set_or_return].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
42 43 44 |
# File 'lib/rubocop/cop/chef/modernize/resource_set_or_return.rb', line 42 def on_send(node) add_offense(node, severity: :refactor) end |