"trans.  (T. Onoma)" <transami / runbox.com> wrote in message news:<200411190110.05257.transami / runbox.com>...
> On Friday 19 November 2004 12:48 am, Daniel Berger wrote:
> | Hi all,
> |
> | I'm trying to write a class where I want to delegate some instance
> | methods as FileTest class methods.  For example:
> |
> | require "forwardable"
> | class Foo < String
> |    extend Forwardable
> |    def_delegator(:FileTest,:directory?)
> |    def initialize(path)
> |       @path = path
> |    end
> | end
> 
> Not sure I understand, but is this what you are trying to do?
> 
>   require "forwardable"
>   class Foo < String
>      extend Forwardable
>      def directory?
>        FileTest.directory?(@path)
>      end
>      def initialize(path)
>        @path = path
>      end
>   end
> 
> 
> ?
> 
> T.

I knew I could do that, but I was trying to find a shortcut rather
than define each method from FileTest manually.  However, the syntax
I'm proposing isn't going to save much in terms of keystrokes, so
maybe it isn't worth it after all.

Regards,

Dan