From: Ropebender Date: 2009-01-14T08:34:16+09:00 Subject: Re: Very rank beginner. The tutorial was on http://www.ruby-lang.org/ It was the tutorial in the sidebar "Ruby in 20 minutes" Worked fine until I tried to define a class Greeter. Instructions said to initialize Greeter with (name = "World") and then define an object g to set the @name. It didn't woork like the tutorial said. => nil irb(main):033:0> class Greeter irb(main):034:1> def initialize(name = "World") irb(main):035:2> end irb(main):036:1> def say_hi irb(main):037:2> puts "Hi #{@name}!" irb(main):038:2> end irb(main):039:1> def say_bye irb(main):040:2> puts "Bye #{@name}!" irb(main):041:2> end irb(main):042:1> end => nil irb(main):043:0> g = Greeter.new("Pat") => # irb(main):044:0> g.say_hi Hi ! => nil irb(main):061:0> g = Greeter.new("Andy") => # irb(main):062:0> g => # irb(main):063:0> Looks like the initialize never worked. Any suggestions? "Tim Greer" wrote in message news:H28bl.10476$qi.9172@newsfe09.iad... > Ropebender wrote: > >> Help. I am a really new beginner looking at Ruby for the first time. >> I was trying to go through the tutorial "Ruby in 20 minutes" on a >> Windows XP machine using fxri. >> >> Some of the code does not work as in the examples. Who should I ask >> for help? >> >> Thanks for any suggestions (even flames are welcome ) >> >> Van!! > > What site were you using the ruby tutorial from? What parts of the code > didn't work, what were the problems or errors? If you've tried the > code and searched for answers, then you'd probably ask here. > -- > Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc. > Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers > and Custom Hosting. 24/7 support, 30 day guarantee, secure servers. > Industry's most experienced staff! -- Web Hosting With Muscle!