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

  • Thread starter SHIGETOMI, Takuhiko
  • Start date
S

SHIGETOMI, Takuhiko

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
 
S

SHIGETOMI, Takuhiko

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
 
D

David A. Black

Hi --

hello, Pit. thank you for your information.


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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top