From: Austin Ziegler Date: 2004-01-01T13:03:43+09:00 Subject: Re: Denying access to methods on DRb On Thu, 1 Jan 2004 10:03:08 +0900, Andre Nathan wrote: > Austin Ziegler said: >> If you only want methods available locally, then you should >> probably put a proxy class on DRb that exposes everything *but* >> those methods. > By 'proxy class' you mean something like this: > class Foobar > def foo > puts 'foo' > end > > def bar > puts 'bar' > end > end > > class FooProxy # only 'foo' exposed > def foo > Foobar.new.foo > end > end More or less. You're want to do FooProxy more like: class FooProxy def initialize @foo = Foobar.new end def foo @foo.foo end end However, most of the hard work of doiing this sort of thing has actually been provided in Ruby through DelegateClass and SimpleDelegate. You can find information on these in the Pickaxe book. -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2003.12.31 * 23.03.30