#from http://pragmaticprogrammer.com/titles/ruby/code/smp387.html # comments added class Test # executable code puts "Class of self = #{self.class}" # the class object type puts "Name of self = #{self.name}" def Test.say_hello # a class method (in metaclass) puts "Hello from #{name}" end say_hello # execute class method end