From: Daniel Sheppard Date: 2005-12-08T15:35:08+09:00 Subject: Re: Are my metaprogramming underpants showing? Considering that there seems to be at least one mandatory argument (api_key), you could do: require 'calibre/functor' functor_factory = lambda { |*symbols| Functor.new { |op, *args| new_sym = symbols+[op] if args.empty? functor_factory[*new_sym] else puts "call: http://flickr.com/services/rest/?method='#{new_sym}'" puts "with parameters:" p args end } } Flickr = functor_factory[] Flickr.test.echo.momma("api_key" => "something long", "foo" => "bar") > -----Original Message----- > From: Trans [mailto:transfire@gmail.com] > Sent: Thursday, 8 December 2005 2:08 PM > To: ruby-talk ML > Subject: Re: Are my metaprogramming underpants showing? > > Hmm.... that does make it trickier b/c when will the chain end? The > only thing I can think of the top of my head is to use an '!' > method to > indicate it. > > Flickr.test.echo! > > Then you can just return the same Functor-like object collecting the > parts along the way until the '!' is hit. > > T. > > > > ##################################################################################### This email has been scanned by MailMarshal, an email content filter. #####################################################################################