Slide 155
Slide 155 text
def keys_of_null(hsh, check_only)
if check_only.nil?
result = []
hsh.each do |k, v|
result << k if v.nil?
end
if result.empty?
"all good"
else
result
end
else
result = []
hsh.each do |k, v|
result << k if check_only.include(k) && v.nil?
end
if result.empty?
"all good"
else
result
end
end
end
把功能相似的標註出來