mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
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:
parent
40ef08183b
commit
3db8d93fe5
1 changed files with 1 additions and 1 deletions
|
@ -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 = []
|
||||
|
|
Loading…
Reference in a new issue