D
Daniel Berger
Hi all,
Well, I *think* it's the facade pattern. Anyway, I'm trying to do
something like this:
class Foo < String
def method_a
Bar.method_a(self)
end
def method_b
Bar.method_b(self)
end
end
This is easy enough to do by hand for a few methods, but what if I have
many methods from Bar I want to use?
I thought maybe there was a trick with Forwardable I could use, but I
don't see how. Any ideas on how to shortcut this?
Regards,
Dan
Well, I *think* it's the facade pattern. Anyway, I'm trying to do
something like this:
class Foo < String
def method_a
Bar.method_a(self)
end
def method_b
Bar.method_b(self)
end
end
This is easy enough to do by hand for a few methods, but what if I have
many methods from Bar I want to use?
I thought maybe there was a trick with Forwardable I could use, but I
don't see how. Any ideas on how to shortcut this?
Regards,
Dan