I have a constant
TYPES = %w(car truck)
I want to define custom assignment methods dynalically
TYPES.each do |type|
define_method "#{type}s=(objects)" do
But it doesn't work, when I call
myobject.cars=objects
I am getting an error method doesn't exists although I can trace it
puts myobject.methods
does have a method
cars=(objects)