Classes are objects

Ruby is a consistent object oriented language. There are no primitive data types. There are just objects. Even classes are objects. They also are called first-class objects. Each inherited class is at all times an object instance.

The Ruby class model

Objects are class instances. And the class itself is an instance of its parent class.
This can be proved easily. An example:

classProductend

The class Product is a blank class, which is inherited from Class automatically:

Product.class# => Class

But its super class:

Product.superclass# => Object

is Object indeed. This means each class also inherits all the methods of Object.
So each product instance has specific instance methods, such as:

Class instance variables

Another important object feature is instance variables. They are identified by a single @.
Classes can also have instance variables (with a single @). Hence they only are valid in the class context, they are called class instance variables. There is a clear contrast to class variables (with @@). That difference plays an important role during inheritance.
An example:

classProduct@@vat_factor=0.19@warranty_months=6end

A product not only has a class variable @@vat_factor, but also a class instance variable @warranty_months.
First of all the class variables: