
July 3rd, 2006, 12:02 PM
|
|
Contributing User
|
|
Join Date: Feb 2001
Posts: 184
Time spent in forums: 4 h 38 m 35 sec
Reputation Power: 13
|
|
|
Accessing object members with a symbol/string
In php it is possible to access the members of an object through the use of a string.
ex:
PHP Code:
$member = 'name'
$person = new Person( 'james' )
echo $person->$member
Would print james, making all the usual assumptions about the person class.
Is there anything like this possible in ruby?
__________________
--Tantapants
|