[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

newbie: what is ruby's var_dump()?

r

12/29/2006 2:01:00 AM

thx
-R

5 Answers

Gavin Kistner

12/29/2006 4:03:00 AM

0

r wrote:
> thx
> -R

Answer #1:
Perhaps you meant to ask:
"Hi, I'm used to language AAA, where there is a var_dump()
function/method that does BBB. How can I do the same thing in Ruby?"

If so, please supply values for AAA and BBB (or at *least* AAA) and I'd
be happy to help.


Answer #2:
http://www.google.com/search?q=rub...
....and since I see "PHP" in the title of the first search result, I
feel compelled to point out that this mailing list is for "Ruby" (the
programming language), not "Ruby on Rails" (the web development
framework that uses Ruby the language to get some stuff done). In case
var_dump() is a PHP function that is web related (and not something
part of the core language).

Mat Schaffer

12/29/2006 4:50:00 AM

0


On Dec 28, 2006, at 11:05 PM, Phrogz wrote:

> r wrote:
>> thx
>> -R
>
> Answer #1:
> Perhaps you meant to ask:
> "Hi, I'm used to language AAA, where there is a var_dump()
> function/method that does BBB. How can I do the same thing in Ruby?"
>
> If so, please supply values for AAA and BBB (or at *least* AAA) and
> I'd
> be happy to help.
>
>
> Answer #2:
> http://www.google.com/search?q=rub...
> ...and since I see "PHP" in the title of the first search result, I
> feel compelled to point out that this mailing list is for "Ruby" (the
> programming language), not "Ruby on Rails" (the web development
> framework that uses Ruby the language to get some stuff done). In case
> var_dump() is a PHP function that is web related (and not something
> part of the core language).

I didn't see the original post, but I bet you're looking for one of
the following:
p
pp
Object#inspect

Or if you really need to get everything contained in an object, I
generally use #to_yaml.
-Mat

_why

12/29/2006 6:20:00 AM

0

On Fri, Dec 29, 2006 at 01:49:46PM +0900, Mat Schaffer wrote:
> I didn't see the original post, but I bet you're looking for one of
> the following:
> p
> pp
> Object#inspect
>
> Or if you really need to get everything contained in an object, I
> generally use #to_yaml.

Or, also `y'.

>> y ['elephants', 'dogs', 'mollusks']
---
- elephants
- dogs
- mollusks

_why

r

12/29/2006 2:18:00 PM

0

Phrogz wrote:
> In case
> var_dump() is a PHP function that is web related (and not something
> part of the core language).

var_dump() is core...

It's in the PHP stdlib. so is var_export(). Wonderful functions.

-R

r

12/29/2006 2:31:00 PM

0

Mat Schaffer wrote:
> I didn't see the original post, but I bet you're looking for one of
> the following:
> p
> pp
> Object#inspect
>
> Or if you really need to get everything contained in an object, I
> generally use #to_yaml.
> -Mat

Thanks. Will look all those up. I think #to_yaml will do it,
var_dump()'s output is an HDF also.

Also thanks _why for y, will check it out.

-R