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, 12 insertions, 0 deletions
diff --git a/sample/case.rb b/sample/case.rb
new file mode 100644
index 0000000..f456f02
--- /dev/null
+++ b/sample/case.rb
@@ -0,0 +1,12 @@
+
+case "t"
+when /1/
+ print(1, "\n")
+when /t/
+ print(3..5, "\n")
+when /./
+ print(2, "\n")
+else
+ print("else\n")
+end
+