P
Patrick Gundlach
Dear all,
I'd like to create methods similar to the attr_* way. I'd like to
write
class Foo
lookup_meth :bar, :baz
def some_other_methods
....
end
end
The lookup_meth should define for class Foo methods such as
def bar
# tricky lookup stuff
return value
end
def bar=(obj)
@bar=obj
end
How would I write such lookup_meth? I've been playing a bit with eval,
but I didn't get it quite right.
Patrick
I'd like to create methods similar to the attr_* way. I'd like to
write
class Foo
lookup_meth :bar, :baz
def some_other_methods
....
end
end
The lookup_meth should define for class Foo methods such as
def bar
# tricky lookup stuff
return value
end
def bar=(obj)
@bar=obj
end
How would I write such lookup_meth? I've been playing a bit with eval,
but I didn't get it quite right.
Patrick