Add jruby helper library example (#2258)

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
pull/2259/head
jimtng 2024-02-28 04:29:02 +10:00 committed by GitHub
parent 3de78d17f9
commit 17df2612c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 1 deletions

View File

@ -185,6 +185,15 @@ s_rule.set_triggers([
]) ])
$automationManager.add_rule(s_rule) $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) #### Default Preset (`importPreset` not required)
| Variable | Description | | Variable | Description |
|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `State` | `org.openhab.core.types.State` | | `State` | `org.openhab.core.types.State` |
| `Command` | `org.openhab.core.types.Command` | | `Command` | `org.openhab.core.types.Command` |
| `URLEncoder` | `java.net.URLEncoder` | | `URLEncoder` | `java.net.URLEncoder` |