Use #key? rather than #has_key? in profile_name ternary

lib/inspec/profile_context.rb:28:29: C: [Corrected] Style/PreferredHashMethods: Use Hash#key? instead of Hash#has_key?.
      @profile_name = @conf.has_key?('profile') ? @conf['profile'].profile_name : @profile_id
                            ^^^^^^^^

355 files inspected, 1 offense detected, 1 offense corrected

Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
Miah Johnson 2019-05-17 16:39:14 -07:00
parent 40ef08183b
commit 3db8d93fe5

View file

@ -25,7 +25,7 @@ module Inspec
@profile_id = profile_id
@backend = backend
@conf = conf.dup
@profile_name = @conf.has_key?('profile') ? @conf['profile'].profile_name : @profile_id
@profile_name = @conf.key?('profile') ? @conf['profile'].profile_name : @profile_id
@skip_only_if_eval = @conf['check_mode']
@rules = {}
@control_subcontexts = []