extend self

Discussion in 'Ruby' started by vruz, Aug 28, 2004.

  1. vruz

    vruz Guest

    Florian Groß told me about a trick he uses in order to make module
    methods available to the outside world in a very easy way.

    foo not accessible from the outside world:
    module A; module B; def foo; "foo"; end; end; end;

    this makes it accesible, it communicates well and does
    the job perfectly well, a little gem:

    module A; module B; extend self; end; end;


    Now, will this still be available in Rite ?

    (I'm wondering about this because of the "selector namespaces" feature
    and some comments that have been made about "self")

    Thanks Florian for the tip.

    best,

    vruz

    (I hope I'm getting it right, if not then it's my fault and not Florian's ! :)
     
    vruz, Aug 28, 2004
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.