That is you want?
def method_missing(method, *args)
if method.to_s['=']
self.define_singleton_method(method) do |*args|
self.instance_variable_set("@#{method[0..-2]}", args.first)
end
else
self.define_singleton_method(method) do
self.instance_variable_get("@#{method}")
end
end
self.send(method, *args) rescue super
end