[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Attr; and Moving Namespaces
From:       "T. Onoma" <transami () runbox ! com>
Date:       2004-08-25 11:43:02
Message-ID: 200408250741.10199.transami () runbox ! com
[Download RAW message or body]

On Wednesday 25 August 2004 05:45 am, Pit Capitain wrote:
>[snip]
> or don't define a new class in Tes but simply include the module in the
> top-level class Object:
>
>    module Tes
>      def t
>        puts "x"
>      end
>    end
>
>    class Object
>      include Tes
>    end
>
>    o = Object.new
>    o.t
>
> or extend only the new Object instance with the module:
> [snip]
> Regards,
> Pit

Thanks Pit. Just to be clear, I am indeed attempting to accomplish exactly 
what my original example pretends to do. I have some modifications for the 
the core ruby libs (like Object) and I was hoping that I could encapsulate 
them in a namespace and then "reload" them into the toplevel at a later point 
in execution.  In effect gaining (somewhat) dynamically controllable core 
class modifications. While not nearly as concise as I had hoped, your 2nd 
example above can be made to do the job. Thanks!

T.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic