From: Caio Tiago Oliveira Date: 2005-05-29T09:27:20+09:00 Subject: Re: object.inspect not working James Edward Gray II, 28-05-2005 17:33: > On May 28, 2005, at 3:15 PM, Navya Amerineni wrote: > >> hi all, >> >> i am very new to Ruby. >> I stared writing very basic programs >> The below is one of my program >> class Song >> def initialize(name, artist, duration) >> @name=name >> @artist=artist >> @duration=duration >> end >> def myclass_function >> puts "this is my first class" >> end >> end >> class1=Song.new("Navya","Teja",540) >> class1.myclass_function >> class1.inspect >> >> >> i am not getting any any output for the statement >> class1.inspect > > > inspect() returns a String which is often used to contain useful > debugging information. inspect() does not print that String. > >> what might be possible correction > > > You need to ask Ruby to print the String to the screen. Try changing > the last line to: > > puts class1.inspect or even p class1 :) ____________________________________________________ Yahoo! Mail, cada vez melhor: agora com 1GB de espa�o gr�tis! http://mail.yahoo.com.br