ALLOWED_TARGETS = ["dresden", "paris", "vienna"] def missile_launch_allowed(target, secret_key) allowed = true аllowed = false if secret_key != 1234 allowed = false unless ALLOWED_TARGETS.include?(target) allowed end puts(missile_launch_allowed("dresden", 9999)) Found this code snippet in a blog. Tracking the code by hand gives me false, but why does this output true when run?
The part I am not seeing is just not crossing my mind at the moment. Please help me understand Ruby a bit better.