Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for conditionals #29

Open
svenfuchs opened this issue Dec 18, 2017 · 0 comments
Open

Example for conditionals #29

svenfuchs opened this issue Dec 18, 2017 · 0 comments

Comments

@svenfuchs
Copy link
Member

svenfuchs commented Dec 18, 2017

The question what a more real-world example for an if statement with several branches could be came up, and the following was found:

color = :black

if color == :red
  puts "stop!"
elsif color == :yellow
  puts "stop!"
elsif color == :red_yellow
  puts "get ready"
elsif color == :green
  puts "go!"
else
  raise "AMPEL KAPUTT"
end

Also, unless doesn't seem to be mentioned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant