newbie: what is ruby's var_dump()?

P

Phrogz

r said:

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).
 
M

Mat Schaffer

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
 
R

r

Phrogz said:
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

r

Mat said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,222
Messages
2,571,137
Members
47,754
Latest member
Armand37T7

Latest Threads

Top