From: "Bartosz Dziewoński" Date: 2012-01-05T06:58:11+09:00 Subject: Re: Including/selecting modules based on the methods they define 2012/1/4 Jon Hart : > As it stands today, if you specify an action that the vendor product does > not support (for example Foo::Bar.drink), an exception is thrown.  Again, I > want to handle that more gracefully (which is easy enough with > begin/rescue) and then show all the vendor products that do support drink. > > I feel like the answer lies somewhere around responds_to?, however I'd need > to have access to the module name to call responds_to?, and as currently > implemented this code doesn't know the module name. But you do in fact know the module name (as long as it's consistent with the file name): irb(main):013:0> vendor, product = 'foo', 'bar' irb(main):019:0> module = Go.const_get(vendor.capitalize).const_get(product.capitalize) => Go::Foo::Bar I think you'll be able to work from here :) -- Matma Rex