Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

15 lines (14 sloc) 0.378 kb
################################################################################
# 5.05_case_class.rb
################################################################################
array = [ "a", 1, nil ]
array.each{|item|
case item
when String
puts item, " is a String."
when Numeric
puts item, " is a Numeric."
else
puts item, " is a something."
end
}
Jump to Line
Something went wrong with that request. Please try again.