--0015175cdab870e1b2049b62fe68
Content-Type: text/plain; charset=ISO-8859-1
Hi
I guess there is a simple solution to this, but right now, I can't come up
with it.
I want to wrap two external functions to behave like a regular hash.
class MyClass
def props
some_data omeClass::get_prop
some_data.to_h
end
def props[key] alue) # Not a valid construct
SomeClass::set_prop(key, value)
end
end
props["timeout"]
10"
props["timeout"]0"
nil
Now, the getter method works perfectly, but I don't know how to declare the
setter method :o(
Anyone?
Kind regards,
Rolf
--0015175cdab870e1b2049b62fe68--