public interface Script extends ContextListener { public String execute(); }
def execute() return context.getScriptFile().getName() end
require 'java' import 'org.scripthelper.context.ScriptContext' import 'org.scripthelper.context.ScriptHelper' import 'org.scripthelper.context.ContextListener' import 'org.scripthelper.context.DefaultScriptContext' class ScriptClass java_implements 'org.scripthelper.context.ContextListener', 'org.scripthelper.ruby.samples.Script' _ attr_reader :context _ def init(ctx) _ @context = ctx _ end _ def execute() _ return context.getScriptFile().getName() _ end end
Copyright 2019-2020 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence