From: Intransition Date: 2010-11-30T19:08:46+09:00 Subject: Re: Refinements On Nov 29, 11:20 pm, Tony Arcieri wrote: > I'm not really sure I see a useful distinction from DelegateClass. How is: > >     module Foo >       refine Bar do >         def baz; ...; end >       end >     end > > really that different from: > >     module Foo >       class Bar < DelegateClass(::Bar) >         def baz; ...; end >       end >     end > > except for a slightly more terse syntax? Why even use DelegateClass ? module Foo class Bar < ::Bar def baz; ...; end end end And it's a good question (this is exactly the namespace idea that was proposed long ago, btw). The only thing in the way of doing this is Ruby's lack of support for literals. That is to say, if I created an extended String, Foo::String, then literal string notation within the scope of Foo should use that. But I am guessing their are possible subtitles I am missing. Can any one fill us in?