------art_115362_19174549.1167288380009
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Thanks All!!!

Special thanks out to Morton and Phrogz for the extra, very handy, tips!!

On 12/27/06, Phrogz <gavin / refinery.com> wrote:
>
> will wrote:
> > book  ook.new("Ruby Tutorial", "Dave", 831)
> > book.inspect
>
> Others have mentioned the need to output the value you are returning,
> and have suggested:
>   puts book.inspect
> as a way to see that information. I just wanted to add the suggestion
> that the 'p' method:
>   p book
> automatically calls #inspect on the object(s) passed, and then spits
> them to stdout like puts does. (For comparison, the puts method calls
> #to_s on the object(s) passed.) 'p' is very convenient when developing
> and testing out your application, as the output sometimes gives you
> more insight into the actual format of the data...particularly for
> arrays:
>
>   irb(main):001:0> a   1, '2', [ '3 4', 5 ], 6 ]
>   [1, "2", ["3 4", 5], 6]
>
>   irb(main):002:0> puts a
>   1
>   2
>   3 4
>   5
>   6
>   nil
>
>   irb(main):003:0> p a
>   [1, "2", ["3 4", 5], 6]
>   nil
>
> As you can see from that first line, it's the result of #inspect that
> irb uses when outputting the result of the last command. (Both puts and
> p return nil when finished, which is where those two "nil" lines
> come from in irb.)
>
>
>


-- 

watch it - http://www.videobomb.com/posts/show/7091
sign it - http://action.freepress.net/campaign/savethenet
save it - http://savetheinternet.com/

------art_115362_19174549.1167288380009--