class RuboCop::Cop::Chef::Modernize::SetOrReturnInResources
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
@example
### incorrect def severity(arg = nil) set_or_return( :severity, arg, :kind_of => String, :default => nil ) end ### correct property :severity, String
Constants
- MSG
- RESTRICT_ON_SEND
Public Instance Methods
Source
# File lib/rubocop/cop/chef/modernize/resource_set_or_return.rb, line 42 def on_send(node) add_offense(node, severity: :refactor) end