Skip to content

Instantly share code, notes, and snippets.

@zaneli
Created March 10, 2012 14:36
Show Gist options
  • Save zaneli/2011592 to your computer and use it in GitHub Desktop.
Save zaneli/2011592 to your computer and use it in GitHub Desktop.
「Java インターフェースをスクリプト言語で実装する」ブログ用
package com.zaneli.script;
public interface ScriptService {
void echo(String message);
String getName();
int calculate(int num);
}
function echo(message) {
println(message);
}
function getName() {
return "JavaScript Service";
}
function calculate(num) {
return num + 1;
}
def echo(message):
print(message)
def getName():
return "Python Service"
def calculate(num):
return num - 1
def echo(message)
puts message
end
def getName
return "Ruby Service"
end
def calculate(num)
return num * 2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment