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:

<% puts thevar.methods.to_yaml %>

and to see the instance variables:

<% puts thevar.instance_variables.to_yaml %>

No Comments

You can leave the first : )

Leave a Reply

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