From: Dark Ambient Date: 2006-08-10T01:42:09+09:00 Subject: Re: Why is this returning nil? Wow..lot of answers, thanks to all. It works and I've learned a few things in the process. Stuart On 8/9/06, Alexey Vakhov wrote: > Hello! > > You forgot quotes in line print #{@level}. Change it to "print > #{@level}" please. > > 2006/8/9, Dark Ambient : > > class User > > > > def initialize(level, status) > > @level = level > > @status = status > > end > > > > def finda > > if @status == "active" > > print #{@level} > > else > > puts "user not exist" > > end > > end > > end > > > > user1 = User.new(1, "active") > > user2 = User.new(1, "inactive") > > user3 = User.new(2, "active") > > user4 = User.new(3, "inactive") > > > > user1.finda > > > > Something wrong ..not sure > > TIA > > Stuart > > > > > > > -- > Alexey Vakhov mailto:vakhov@gmail.com > >