Newbie: what is ruby's var_dump()?

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=ruby+var_dump
...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

···

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:
ruby var_dump - Google Search
...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).

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

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'.

···

On Fri, Dec 29, 2006 at 01:49:46PM +0900, Mat Schaffer wrote:

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

_why

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