From: Gabriel Dragffy Date: 2007-08-02T23:10:29+09:00 Subject: Beginner's tutorial and poor attempt at classes Hi all I just started with Ruby (yesterday actually). Have been reading the amazing Poignant Guide, and also a couple of other very basic tutorials. From one of these I wrote an example class, now my knowledge of Ruby has expanded a little I tried to rewrite the class to be even better. I thought that the method "setme" would allow the @numberShowing to be changed to any number between 1 and 6... but obviously not...? #/usr/bin/env ruby class Die def initialize roll end def roll @numberShowing = 1 + rand(6) end def showing @numberShowing end def setme value if value === 1..6 @numberShowing = value else puts "A dice has only six sides!" end end end Best regards Gabriel Dragffy gabe@dragffy.com