From: Rick DeNatale Date: 2009-11-24T22:52:40+09:00 Subject: Re: Programming ruby 1.9- question on page 37 On Tue, Nov 24, 2009 at 3:05 AM, 4895 <677zn5@gmail.com> wrote: > not sure what to do which that code at the bottom of page 37. I enter > this code into the command prompt and obviously that isn't right. I > created the folder that I was told to before but I can't remember it > though I did skim a bit to find it. Not clear also on all that syntax > that was used there. I have tried to get a good definition of puts for > a month and have not been able > to. If that is a method why is there another method (say_goodnight > (name)) on the same line? > > Brad Well the code under the box telling you where to download it (at least in the pdf version of the book, too lazy to go upstairs to look at the physical version) is a complete ruby program, either download it or enter it into a file they suggest intro5.rb, And then just run it with: ruby intro5.rb Alternatively you can paste the text into irb. puts say_goodnight("John boy") is the same as puts(say_goodnight("John boy")) and invokes the puts function passing the result returned by invoking say_goodnight("John boy") puts (p 575) is actually a method defined in the Kernel module which is available for all instances of subclasses of Object which includes Kernel. But at this stage of the book, I believe that the author is just trying to give you the 'flavor' of Ruby, It might be better to just read the material, without trying to understand things too deeply. The picture will get clearer as you progress through the book. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale