Hello, How can I see all the properties (member variables) and methods (functions) that are available for an object? Is there a function similar to PHP''s var_dump in MySQL? Many thanks for your assistance. Frank --------------------------------- What are the most popular cars? Find out at Yahoo! Autos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060201/ada51ec8/attachment.html
Hey Frank ! Check out the "Module" class here I believe: http://www.ruby-doc.org/core/ Object, Module and Class all have a slew of "reflection" type methods... but am not sure which one prints "it all out". Have a look and you''ll probably find it. =Dylan On 1/31/06, softwareengineer 99 <softwareengineer99@yahoo.com> wrote:> > Hello, > > How can I see all the properties (member variables) and methods > (functions) that are available for an object? Is there a function similar to > PHP''s var_dump in MySQL? > > Many thanks for your assistance. > > Frank > > ------------------------------ > > What are the most popular cars? Find out at Yahoo! Autos<http://us.rd.yahoo.com/evt=38382/_ylc=X3oDMTEzNWFva2Y2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDMmF1dG9z/*http://autos.yahoo.com/newcars/popular/thisweek.html+%0A> > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060201/66f20693/attachment.html
Thanks Dylan for the resource. I will check it out now.
Frank
Dylan Stamat <dylans@gmail.com> wrote: Hey Frank !
Check out the "Module" class here I believe:
http://www.ruby-doc.org/core/
Object, Module and Class all have a slew of "reflection" type
methods... but am not sure which one prints "it all out".
Have a look and you''ll probably find it.
=Dylan
On 1/31/06, softwareengineer 99 <softwareengineer99@yahoo.com >
wrote:Hello,
How can I see all the properties (member variables) and methods (functions)
that are available for an object? Is there a function similar to PHP''s
var_dump in MySQL?
Many thanks for your assistance.
Frank
---------------------------------
What are the most popular cars? Find out at Yahoo! Autos
_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
---------------------------------
What are the most popular cars? Find out at Yahoo! Autos
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060201/20f63da4/attachment.html
> How can I see all the properties (member variables) and methods > (functions) that are available for an object? Is there a function > similar to PHP''s var_dump in MySQL?You can use the ''methods'' and ''instance_variables'' methods. :-) obj.methods obj.instance_variables Or in a view <%= debug(obj) %> will give you a nicely formatted YAML style representation of the object. --Nicky
softwareengineer 99 wrote:> Hello, > > How can I see all the properties (member variables) and methods > (functions) that are available for an object? Is there a function > similar to PHP''s var_dump in MySQL?object.inspect is probably what you''re after. -- Alex