David,
I am maintaining a Rails App that is using backgroundDrb. It creates a helper file called dbrb_test_helper.rb in the test directory. Amongst other things, it has the following piece of code that I cannot understand:
class Object
def self.metaclass
class << self
self
end
end
...
end
So we are adding a “class” method to the Object (class? instance?) named ‘metaclass’. So if I understand your teaching thus far: There is a ghost class created for the object ‘Object’ that has a method metaclass defined in it. So far so good, but what in the world are the following lines of code are for?
class << self
self
end
I don’t get it. Kindly explain. This is one too many selfs for me.
Bharat