From: Adam Prescott Date: 2010-09-15T05:00:04+09:00 Subject: Re: Extend & Declarative relations between object attributes Extend is include on the eigenclass/metaclass/singleton class. In this case, it's like saying C.extend Observable because of the implied "self". On Tue, Sep 14, 2010 at 8:52 PM, Ralph Shnelvar wrote: > Sunday, September 12, 2010, 6:19:53 PM, you wrote: > > JV> # Let's just include Observable globally. Conservatively, one would do: > JV> # > JV> #   class C > JV> #     extend Observable > JV> #     include Observable::Match   # if desired > JV> #     ... > JV> #   end > > I give.  What does >  extend Observable > do? > > I see in Dave Thomas' *Programming Ruby 1.9* that extend "Adds to obj the instance methods from each module given as a parameter". > > So ... what object is "extend Observable" referring to?  The class C object? (That is, the class that is C rather than the instance that is C.)  Is this related to some singleton stuff? > > And how is the extend different than the include? > > > Ralph