On 10/18/05, gwtmp01 / mac.com <gwtmp01 / mac.com> wrote:
> How about:
>
> module Kernel
>   def send_each(*mlist)
>     mlist.inject(self) do |obj, mname|
>         return nil unless obj
>         obj.send(mname)
>     end
>   end
> end
>
> puts "ruby rocks".send_each(:reverse, :chop, :capitalize)   # ->
> "Skcor ybu"
Nice, but your example is no different to

  puts "ruby rocks".reverse.chop.capitalize

Maybe this shows off your method better:

class String
  def nil_method
    nil
  end
end
puts "ruby rocks".send_each(:reverse, :chop, :nil_method, :capitalize)
  # -> nil

Regards,

Sean