edubkendo
12/5/2013 - 8:17 PM

jscript.rb

require "java"
require "DuckTyping.jar"

duck = Java::org.edubkendo.ducks.Duck.new
chicken = Java::org.edubkendo.ducks.Chicken.new

Java::org.edubkendo.ducks.DuckTyping.duck_typing(duck)
Java::org.edubkendo.ducks.DuckTyping.duck_typing(chicken)

# >> Quack!
# >> Um, cluck, cluck!