Chad Perrin wrote: > On Wed, Apr 04, 2007 at 07:49:05AM +0900, Jamal Soueidan wrote: >> >> why does this happend? >> >> I cannot even write this below >> >> puts 'nil' unless just_something.nil? >> >> hope someone can help me understand whats wrong :) > > Basically, everything *that exists* in Ruby is an object. If it doesn't > exist yet, it can't be an object. You have to have a "just_something" > before it can be an object. You could try creating a "just_something" > with an assignment, for instance: > > irb(main):001:0> just_something = 0 > => 0 > irb(main):002:0> puts just_something.class.to_s > Fixnum > => nil how can I check if its not a object because then its empty and not created ? -- Posted via http://www.ruby-forum.com/.