I’ve clearly go a lot of repetition in the following methods:
def name=(value)
write_attribute(:name, if [0,“0”,""," “].include? value then nil
else value end)
end
def address=(value)
write_attribute(:address, if [0,“0”,”"," “].include? value then nil
else value end)
end
def city=(value)
write_attribute(:city, if [0,“0”,”"," "].include? value then nil
else value end)
end
Can someone tell me the convention to DRY this code? I’m wondering if I
use a lambda but am not quite sure that’s the right path or how to do
that.
Thanks,
Bill