From: Tobias Reif Date: 2001-10-28T00:52:25+09:00 Subject: [ruby-talk:23629] Re: sleeping, calling methods inside class defs David, Guy, thanks a lot for your help. In the following: what would be the most convenient and elegant way to omit the line t.assign_hey_ho_string (and perhaps more code)? ----- class Tobi def hey "hey!\n" end def ho "ho!\n" end def assign_hey_ho_string @hey_ho_string = hey + ho end def hey_ho_string @hey_ho_string end end t = Tobi.new t.assign_hey_ho_string puts t.hey_ho_string ----- I now know that I can't just call @hey_ho_string = hey + ho inside the classdef. What would be a good way to achieve the same effect in this case, without having to call the assign method from the object? Tobi -- Tobias Reif http://www.pinkjuice.com/myDigitalProfile.xhtml go_to('www.ruby-lang.org').get(ruby).play.create.have_fun http://www.pinkjuice.com/ruby/