Skip to content

Instantly share code, notes, and snippets.

@tokudan
Last active December 16, 2017 15:02
Show Gist options
  • Save tokudan/a3b2ac29d195bdddf560004d2c252027 to your computer and use it in GitHub Desktop.
Save tokudan/a3b2ac29d195bdddf560004d2c252027 to your computer and use it in GitHub Desktop.
[nix-shell:~]$ cat test.rb
required = String
case required
when String
puts "performing string checks"
when Integer
puts "performing integer checks"
else
raise "unsupported"
end
[nix-shell:~]$ ruby test.rb
test.rb:8:in `<main>': unsupported (RuntimeError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment