I just started playing with JRuby. This is my first ruby post. I had a hard time understanding classes vs objects in Ruby. It doesnt mean like what classes & objects in
Ramesh, in ruby everything is an object, and a Class is no exception.
try this in irb
ruby-1.9.2-p136 :001 > o = Object.new
=> #
ruby-1.9.2-p136 :002 > o.is_a? Class
=> false
ruby-1.9.2-p136 :003 > o.is_a? Object
=> true
in this case, I've created an instance of an Object, and checked if it's a class (false) or a Object (true).
A Class in ruby, is some kind of template object used to create instances of that class. Sorry that this is not super clear. The key concept is that ruby is a pure object oriented language, as opposed to Java.