Hi,

On Sep 7, 2008, at 9:05 AM, Trans wrote:

> def grumpize
>   to_self(to_s.upcase + '!!!!!!!!!')
> end

This is a bit of a confusing idiom, especially when expanded:

   self.to_self(self.to_s.upcase + '!!!!!!!!!')

You may make yourself slightly clearer with a block method. A  
simplified example:

   class Object
     def returning_initial_class(&block)
       yield(self).__send__ case self
         when String then :to_s
         when Symbol then :to_sym
       end
     end
   end

   module Grumpy
     def grumpize
       returning_initial_class { |grump| grump.to_s.upcase +  
'!!!!!!!!!' }
     end
   end

It's cleanest to just define String#grumpize and Symbol#grumpize  
individually.

Stephen