From: Robert Dober Date: 2006-09-04T01:47:30+09:00 Subject: Re: Already stalled in Pick Axe book - could use some help ------=_Part_108306_24197434.1157302025376 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/3/06, James Britt wrote: > > Jeff Rohrer wrote: > > Hi, total noob here. I'm only on page 25 of the Pick Axe book and I'm a > > little stuck: > > > > I'm running Ruby version 1.8.4 on Windows XP Home Edition. I'm entering > > code via irb. > > > > Here's the problem: I enter the following code from the book: > > > > class Song > > def initialize(name, artist, duration) > > @name =3D name > > @artist =3D artist > > @duration =3D duration > > end > > > > def to_s > > "Song: #@name--#@artist (#@duration)" > > end > > end > > > > I just tried this on WinXP, ruby 1.8.4 (2005-12-24) [i386-mswin32] > > demo.rb has the code you provided. > > d:\tmp>irb > irb(main):001:0> load 'demo.rb' > =3D> true > irb(main):002:0> song =3D Song.new("Bicylops", "Fleck", 260) > =3D> # > irb(main):003:0> song.to_s > =3D> "Song: Bicylops--Fleck (260)" > irb(main):004:0> > > I think you may have something different in your actual source code. Exactly maybe the lines end # of initialize def to_s are missing HTH Robert > -- > James Britt > > "Simplicity of the language is not what matters, but > simplicity of use." > - Richard A. O'Keefe in squeak-dev mailing list > > --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_108306_24197434.1157302025376--