M
Michael Schuerig
I want to write a method that can be called like this
obj.attr(qualifier) = value
So far, I don't see how to achieve this. I've tried
class C
def attr=(qualifier, value)
...
end
end
as well as
class D
def attr(qualifier)
Proxy.new(self, qualifier)
end
class Proxy
def =(value)
...
end
end
end
Neither is valid Ruby, apparently. Is there another, working way?
Michael
obj.attr(qualifier) = value
So far, I don't see how to achieve this. I've tried
class C
def attr=(qualifier, value)
...
end
end
as well as
class D
def attr(qualifier)
Proxy.new(self, qualifier)
end
class Proxy
def =(value)
...
end
end
end
Neither is valid Ruby, apparently. Is there another, working way?
Michael