From: Jeppe Jakobsen Date: 2006-02-13T05:21:34+09:00 Subject: Implanting a new method for a class ------=_Part_7188_18918120.1139775677246 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi there, I have a question regarding how to implant a new method into the class Array. I would like to write a ruby file that sums all of the digits in an array. I have tried this: class Array def Array.sum until (Array.empty?) arraySum +=3D Array.pop end puts arraySum end end Gave no error when I ran the code. My problem occur when i try to use this method: require "Library/Array_sum.rb" a =3D [1..100] a.sum I get a NoMethodError on sum. Can anybody tell me what I did wrong here? Thanks in advance :) ------=_Part_7188_18918120.1139775677246--