diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-02-13 09:52:10 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-02-13 09:52:10 -0800 |
commit | 404a9bc88be538769c6c80b3b31f39a6582991d2 (patch) | |
tree | 2f8795e5f64153440c22a522d669c235a627f289 /lib/chef/node/common_api.rb | |
parent | b949a48acc21d4b64869bd7b834708d5232b1f2a (diff) | |
download | chef-404a9bc88be538769c6c80b3b31f39a6582991d2.tar.gz |
fix specs: RedundantReturn, RedundantSelf, RedundantBegin
department of redundancy department
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/node/common_api.rb')
-rw-r--r-- | lib/chef/node/common_api.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/chef/node/common_api.rb b/lib/chef/node/common_api.rb index c9786807e9..a703c1ef54 100644 --- a/lib/chef/node/common_api.rb +++ b/lib/chef/node/common_api.rb @@ -24,7 +24,7 @@ class Chef # method-style access to attributes def valid_container?(obj, key) - return obj.is_a?(Hash) || (obj.is_a?(Array) && key.is_a?(Integer)) + obj.is_a?(Hash) || (obj.is_a?(Array) && key.is_a?(Integer)) end private :valid_container? @@ -85,16 +85,14 @@ class Chef end end end - return true + true end # this is a safe non-autovivifying reader that returns nil if the attribute does not exist def read(*path) - begin - read!(*path) - rescue Chef::Exceptions::NoSuchAttribute - nil - end + read!(*path) + rescue Chef::Exceptions::NoSuchAttribute + nil end # non-autovivifying reader that throws an exception if the attribute does not exist |