i have method, which returns either an array (if it contains any elements) or false if it is nil:
def check_for_four
@four = []
check_values.each do |key, value| ###check_values return hash with key and values as numbers
@four << key if value == 4
end
if @four == nil
return false
else
return @four
end
end
but later on, if i call a method
if some_object.check_for_four
puts "true"
else
puts "false"
end
it always return true, even if @four array is empty. Why is that?