class Person
def name
puts "Dave"
end
end
puts Person.object_id
There are only two ways of accessing methods :
1) Someclass.method in case of class methods. #where Someclass is a class.
2) and Object.method when the method being accessed is a regular method declared inside a class. and Object is an instance of a class.
It follows the pattern Object.method so, does it mean Person class is really an object?
or object_id is a class method? The latter seems unlikely because class methods cannot be inherited into an instance. but when we do something like this :
a = Person.new
a.methods.include?("object_id") # this produces true
a is an instance of Person class so object_id cannot be a class method.