Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created October 30, 2008 23:41
Show Gist options
  • Select an option

  • Save ELLIOTTCABLE/21176 to your computer and use it in GitHub Desktop.

Select an option

Save ELLIOTTCABLE/21176 to your computer and use it in GitHub Desktop.
something = Array.new
puts "I am an #{something.class}"
case something
when Fixnum
puts 'I\'m a number'
when Array
puts 'I\'m an array'
else
puts 'I\'m a monster! Aaaargh!'
end
if something.class == Array
puts "I == Array"
end
I am an Array
I'm an array
I == Array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment