« Return to Thread: What is the current syntax for defining a class in JRuby that implements a Java interface?

Re: What is the current syntax for defining a class in JRuby that implements a Java interface?

by Ken McDonald :: Rate this Message:

Reply to Author | View in Thread

Yup, what I'd seen was definitely _not_ the current way of doing it :-).
In retrospect this is
obvious, but I'd never have guessed it myself :-). Thanks!

Ken


Peter K Chan wrote:

> Ken,
> The new way is to use "include" to include the Java interface, as if
> it is a Ruby module.
>
> For example:
>
> Class RunnableRuby
>   include java.lang.Runnable
>
>   def run
>     puts :Running
>   end
> end
>
> Peter
>
> -----Original Message-----
> From: Kenneth McDonald [mailto:kenneth.m.mcdonald@...]
> Sent: Wednesday, August 15, 2007 11:57 PM
> To: user@...
> Subject: [jruby-user] What is the current syntax for defining a class in
> JRuby that implements a Java interface?
>
> I've seen an 'old' way to do it, but suspect there is something more
> modern. Is there a page anywhere that gives quick examples of how to do
> Java-specific stuff in JRuby?
>
> Thanks,
> Ken
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>  


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

 « Return to Thread: What is the current syntax for defining a class in JRuby that implements a Java interface?