if send
is used for calling a method with a symbol (which for an attribute is the getter method)
what is the opposite for accessing the setter method?
object.send(:attr)
is to object.attr
as
______ is to object.attr = value
sorry for the analogies, I don't know how to better explain this
I assume you're trying to dynamically set the value of various attributes on an object.
try the following:
object.send("#{attr}=", value)
There was a similar question asked yesterday - it might help as it's a more specific example.
Try using:
object.send(column + '=', column_value)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With