show instance methods and variables in Ruby

as i am just learning Ruby (in at the deep end, the way we like it!), i needed to see what is available for certain objects (instances of) and variables methods etc, here’s what i know so far:

to show methods:

[code]
<% puts thevar.methods.to_yaml %>
[/code]

and to see the instance variables:

[code]
<% puts thevar.instance_variables.to_yaml %>
[/code]




No Comments


You can leave the first : )



Leave a Reply

Your email address will not be published. Required fields are marked *