walter / mwsewall.com wrote:

> class QArray < Array
>   def sum_e
>     inject(0){|sum, item| sum+=item.e}
>   end
> end

Why not just put sum_e into Array, instead of creating a subclass?  That 
would then allow it to be accessed from any array object.

   class Array
     def sum_e
       ...
     end
   end

   ...
   sum = a.find_all {...}.sum_e

-- 
Jamis Buck
jgb3 / email.byu.edu
http://www.jamisbuck.org/jamis

ruby -h | ruby -e 
'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a << 
r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"'