From: Mark Van Holstyn Date: 2006-04-08T01:21:45+09:00 Subject: Re: Simple Question About Deleting Instances ------=_Part_8627_12592421.1144426901603 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I think you problems is in the report class. Each time you do report =3D Report.new, you won't be getting any data carried over from the last report object. Is report.ID_list a method on the class? or on the instance? The only way I can see it keeping data around is if you have some type of data structure as a class variable, when you meant it to be an instance variable= . mark On 4/7/06, Nathan Olberding wrote: > > > Some code would help. Saying: ... > > require 'my_stuff' # Includes the Report class > > file_list =3D Dir.new("reports") > yes_list =3D [] > no_list =3D [] > file_list.each do |file| > if file_name =3D~ /yes/ > report =3D Report.new(file_name) > yes_list.push(report.ID_list) > elsif file_name =3D~ /no/ > report =3D Report.new(file_name) > no_list.push(report.ID_list) > end > end > > puts yes_list.inspect > puts no_list.inspect > > > > Both yes and no lists gather way more data than they're supposed to and > based on the excess data I'm seeing, it looks like it just isn't > deleting old data from the old instance of report. > > I've (feebly) tried report.delete, report.replace, and report =3D nil at > the end of each if block, if that helps convey my goal. > > -- > Posted via http://www.ruby-forum.com/. > > -- Mark Van Holstyn mvette13@gmail.com http://lotswholetime.com ------=_Part_8627_12592421.1144426901603--