=begin Class < Module < Object Kernel module Object includes Kernel Kernel instance methods documented with Object Kernel module methods documented in Kernel. They are called without a receiver. Ruby classes are dynamic. When we define a class an object of type Class is created and assigned to a constant with the name of the class. =end class A # in an A instance here p self # p is module method in Kernel # supposed to use inspect and separator Kernel.p self # alternative p self.inspect # inspect in Object # uses to_s if not overridden p self.to_s # to_s in Object, returns string rep p self.class # class is an Object method p self.name # name is a Module method s = "house" p s.length # class def is executable p self.const_defined? "PI" # Module instance method, Class < Module end p A.const_defined? "PI" # Module instance method a = A.new # p a.const_defined? # variable a instance of A, not Class