I m trying to do an instance_eval
followed by a attr_accessor
inside initialize
, and I keep getting this: ``initialize : undefined method attr_accessor `. Why isn t this working?
The code looks kind of like this:
class MyClass
def initialize(*args)
instance_eval "attr_accessor :#{sym}"
end
end