« 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 Peter K Chan :: Rate this Message:

Reply to Author | View in Thread

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

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