From 17df2612c70d5c9f5f58c20af2efdaf8e1247cba Mon Sep 17 00:00:00 2001 From: jimtng <2554958+jimtng@users.noreply.github.com> Date: Wed, 28 Feb 2024 04:29:02 +1000 Subject: [PATCH] Add jruby helper library example (#2258) Signed-off-by: Jimmy Tanagra --- configuration/jsr223.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configuration/jsr223.md b/configuration/jsr223.md index 8d9b08da1..781f93d03 100644 --- a/configuration/jsr223.md +++ b/configuration/jsr223.md @@ -185,6 +185,15 @@ s_rule.set_triggers([ ]) $automationManager.add_rule(s_rule) + +# And the same rule using the bundled helper library: + +rule "A Cron Rule in Ruby" do + every :minute + run do + logger.info "Hello World from JRuby" + end +end ``` ::: @@ -233,7 +242,7 @@ The `default` preset is preloaded, so it does not require importing. #### Default Preset (`importPreset` not required) | Variable | Description | -|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `State` | `org.openhab.core.types.State` | | `Command` | `org.openhab.core.types.Command` | | `URLEncoder` | `java.net.URLEncoder` |