[Q] how to cancel the 'extend' which once has done

dear guys,

is it possible to undo the 'extend' ?

module X
end

class C
end

c = C.new
p c.kind_of?(X) #=> false
c.extend X
p c.kind_of?(X) #=> true
c.decommisson(X) # <- my pseudo instruction to undo the 'extend'
p c.kind_of?(X) #=> false

best regards,

vscp://void/3d/universe/milky-way-galaxy/orion-arm/sol-solar-system/
3rd-planet/fareast/jp/tky/shigetomi.takuhiko.5618

SHIGETOMI, Takuhiko schrieb:

dear guys,

is it possible to undo the 'extend' ?

module X
end

class C
end

c = C.new
p c.kind_of?(X) #=> false
c.extend X
p c.kind_of?(X) #=> true
c.decommisson(X) # <- my pseudo instruction to undo the 'extend'
p c.kind_of?(X) #=> false

best regards,

I haven't used it yet, but I think Shin-ichiro Hara's import-module is what you're looking for:

   http://blade.nagaokaut.ac.jp/~sinara/ruby/import-module

Regards,
Pit

hello, Pit. thank you for your information.

I haven't used it yet, but I think Shin-ichiro Hara's import-module is
what you're looking for:

   http://blade.nagaokaut.ac.jp/~sinara/ruby/import-module

intriguing! i bookmarked this.
it shows several important/interesting techniques. they are useful.

unfortunately, this is now what i am seeking.
since this import-module manipulates not an instance but a class.

thanx, again.

bxwp://void/3d/universe/milky-way-galaxy/orion-arm/sol-solar-system/
3rd-planet/fareast/jp/tky/shigetomi.takuhiko.5618

Hi --

ยทยทยท

On Tue, 27 Sep 2005, SHIGETOMI, Takuhiko wrote:

hello, Pit. thank you for your information.

I haven't used it yet, but I think Shin-ichiro Hara's import-module is
what you're looking for:

   http://blade.nagaokaut.ac.jp/~sinara/ruby/import-module

intriguing! i bookmarked this.
it shows several important/interesting techniques. they are useful.

unfortunately, this is now what i am seeking.
since this import-module manipulates not an instance but a class.

Actually it lets you do this:

   obj.import(Mod) { ... }

where the object will be extended with Mod for the duration of the
block.

David

--
David A. Black
dblack@wobblini.net