On Tue, Jun 26, 2012 at 1:40 AM, Aleksey Zapparov <[email protected]> wrote:
> What's the difference between subject?

The comparison does not really make much sense IMHO since both do very
different things:

"class <<self ... end" opens the singleton class of the instance
referenced to by "self".

"extend self" only works if "self" references a module.  It will
include a module's instance methods in the module instance itself -
making them class methods.

Cheers

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to