Some interesting findings from web-dev land…
I needed to access a Ruby object member (attribute) today, dynamically, using a string variable to make the call.
In PHP I would have done this:
123$member_name = ‘dynamic_member_name’;
$object->$member_name;
After a bit of Googling I figured out the Ruby way:
123member_name = ‘dynamic_member_name’
object.send(member_name)
Hmmmmmm. Must say that feels a bit weird. I’m sure it’s proper OO though.