why the class of subclass is superclass
- by Raj
def singleton_class
class << self
self
end
end
end
class Human
proc = lambda { puts 'proc says my class is ' + self.name.to_s }
singleton_class.instance_eval do
define_method(:lab) do
proc.call
end
end
end
class Developer < Human
end
Human.lab # class is Human
Developer.lab # class is Human ; oops
Why Developer.lab is reporting that it is Human ?