Trans wrote:
> Yes, but so is everything.
Hmmm...I'm not the sharpest tool in the shed, but I don't think that is
correct. There are first-order objects like classes and modules.
Normally #included gets the class or module object itself, not an
instance. At least that's how I've always thought it worked.
module Test
def self.included(base)
p base.instance_of?(C) # => false
base.module_eval { # <- extends the actual class, not an instance
def m
puts 'Howdy do'
end
}
end
end
class C
include Test
end
C.new.m
Regards,
Jordan