In Ruby programming method ‘class’ is used to get ruby class of an object. Method ‘class’ is used to tells an object to display its class, See an example below:
Suppose class name is ‘AnimalName’ And object name is ‘cat’
class AnimalName
end
cat = AnimalName.new
puts cat.class
#=> displays: “AnimalName”