From: Joey Date: 2006-05-09T16:13:41+09:00 Subject: Re: Print Out Code in Program ------=_Part_19456_23082723.1147158819478 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline @ab =3D <<-CODE class Ab def code a =3D 5 b =3D 2 end end CODE eval(@ab) def print_class(klass) print instance_variable_get "@#{klass.to_s.downcase}" end print_class(Ab) On 5/9/06, Patrick wrote: > > Thanks, the code works, but is there still a way to print out everything > in a class by just referencing the class name? To get everything to be > displayed using this code it has to basicaly start before the class and > end afterward. > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_19456_23082723.1147158819478--