DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Parameterized Instance Variables

01.09.2006
| 3000 views |
  • submit to reddit
        // useful when you want to obtain more than one instance of the same type of variable on the 
// same page. i.e. two different addresses. credit goes to argv[0] in #rubyonrails on freenode 

instance_variable_get("@#{address_type}_address").country.name