From: Peter Szinek Date: 2006-12-15T18:01:18+09:00 Subject: method_missing question Hello, I am using method_missing to build a structure (similar to a tree) like this: P.book do P.title P.price end class P def self.method_missing(method_name, *args, &block) #add a node with name 'method_name.to_s' to the tree etc. end end Now, the problem is I would like to write the above example like this: book do title price end i.e. without the Ps. P's sole purpose is to define method_missing - I did not want to override Object.method_missing since I would like to release this code to the wild and I think it could collide with my potential future user's Object.method_missing. I have then experimented with modules (mimicking namespace functionality) but that still did not provide the possibility to omit the class name. I would need something equivalent to include - you can omit the module name if you include the module - but with classes. I have no idea if this is possible in Ruby, but is there something like run this code in a different context or something? TIA, Peter __ http://www.rubyrailways.com