module Test
def class_type
"This class is of type:#{self.class}"
end
end
class TestClass
extend Test
end
puts TestClass.class_type #=> This class is of type:Class
module Test
@a = 1
def class_type
"This class is of type:#{self.class}"
end
end
class TestClass
include Test
end
# puts TestClass.class_type #=> undefined method `class_type' for TestClass:Class (NoMethodError)
puts TestClass.new.class_type #=> This class is of type:TestClass