From: Robert Dober Date: 2007-03-16T06:00:23+09:00 Subject: Re: Anyone playing with higher order messaging in ruby? --------------------- 8< --------------------- module Enumerable class MapProxy def initialize obj @obj = obj end #def initialize obj def method_missing name, *args, &blk @obj.map do | ele | ele.send name, *args, &blk end end #def method_missing name, *args, &blk end #class MapProxy alias_method :aliased_map, :map def map *args, &blk return MapProxy.new( self ) if args.length.zero? && blk.nil? aliased_map *args, &blk end #def map *args, &blk end #module Enumerable ---------------- 8< -------------------- This is from a thread of 2006-09-27 posted the 28th, looks familiar it was about "for or against the magic dot notation" but the functionality is the same :) the French say: "Les grands esprits se resemblent", but my modesty forbids any translations ;) Cheers Robert