From: James Britt Date: 2006-02-13T05:56:45+09:00 Subject: Re: Implanting a new method for a class Jeppe Jakobsen wrote: > ... > I get a NoMethodError on sum. Can anybody tell me what I did wrong here? > Thanks in advance :) > You've defined a class method (e.g. Array.sum) You need to do this: class Array def sum until (Array.empty?) ... -- James Britt http://www.ruby-doc.org - Ruby Help & Documentation http://www.artima.com/rubycs/ - The Journal By & For Rubyists http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys http://www.30secondrule.com - Building Better Tools