my_array.send(a)
or
my_array.send(b)
Julian.
Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)
VIDEO #4 coming soon!
http://sensei.zenunit.com/
On 16/04/2008, at 3:22 PM, rushnosh wrote:
>
> a = "first"
>
> b = "last"
>
> i want to do
>
> my_array.a
> or
> my_array.b
>
> how would i do this?
>
> instead of doing but to get the same result
>
> my_array.frist
> my_array.last
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---