When I typed the below in my IRB:

{}.class
#=> Hash  #<~~ I got this one.

print {}.class
#NilClass

Why the above showing `NilClass`, but the below are not?

print [].class
#Array=> nil
print (1..2).class
#Range=> nil
print 2.class
#Fixnum=> nil

-- 
Posted via http://www.ruby-forum.com/.