Skip to content

Commit 4c6e1f6

Browse files
➕ Add Ruby language
In Ruby we don't have a normal switch statement, we use the case statement instead, wheich is pretty the same switch => case case => when default => else
1 parent eef5aaf commit 4c6e1f6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

switch.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
case day_number
2+
when 1
3+
puts "Saturday"
4+
when 2
5+
puts "Sunday"
6+
when 3
7+
puts "Monday"
8+
when 4
9+
puts "Tuesday"
10+
when 5
11+
puts "Wednesday"
12+
when 6
13+
puts "Thursday"
14+
when 7
15+
puts "Friday"
16+
end

0 commit comments

Comments
 (0)