|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
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:
Would print james, making all the usual assumptions about the person class. Is there anything like this possible in ruby?
__________________
--Tantapants |
|
#2
|
||||
|
||||
|
Naturally
object.send(name) Works for functions and variables.
__________________
~James [Not currently seeking freelance work] Like philosophy or interested in spirituality? Philosophorum. Game Dev Experts Forums Foresight Linux - Because your desktop should be cool! Linux FAQ FedoraFAQ UbuntuGuide |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Accessing object members with a symbol/string |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|