hash.delete('override') end
if hash.has_key?('id')
hash.delete_if { |key, _| key == "SCHED_HOST" }
hash.delete_if { |key, _| key == "SCHED_PORT" }
hash.delete_if { |key, _| key == "my_name" }
hash.delete_if { |key, _| key == "my_email" }
hash.delete_if { |key, _| key == "lab" }
for each line it may traverse the hash. you can just delete the key no matter the hash has the key or not, hash.delete 'SCHED_HOST' ... or you can do like this: if hash.has_key?('id') d_keys = ["SCHED_HOST", "SCHED_PORT", "my_name", "my_email", "lab"] hash.delete_if { |k| d_keys.include? k } end
Thanks, Luan Shengde
end revise_hash(hash, load_include_yamls(@default_yamls), false) unless @default_yamls.empty? revise_hash(hash, load_include_yamls(@override_yamls), true) unless @override_yamls.empty?
-- 2.23.0