summaryrefslogtreecommitdiff
path: root/sample/case.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/case.rb')
-rw-r--r--sample/case.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/sample/case.rb b/sample/case.rb
index f456f023d3..e844cddfd6 100644
--- a/sample/case.rb
+++ b/sample/case.rb
@@ -1,12 +1,14 @@
+# case statement example
+# output:
+# 3..5
case "t"
when /1/
- print(1, "\n")
+ print 1, "\n"
when /t/
- print(3..5, "\n")
+ print 3..5, "\n"
when /./
- print(2, "\n")
+ print 2, "\n"
else
- print("else\n")
+ print "else\n"
end
-