Created
January 22, 2021 05:33
-
-
Save dannyrandall/8b11d590099ba3762d30c825b2fd1862 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruleset hello_world { | |
meta { | |
name "Hello World" | |
description << | |
A first ruleset for the Quickstart | |
>> | |
author "Daniel Randall" | |
shares hello | |
} | |
global { | |
hello = function(obj) { | |
msg = "Hello " + obj; | |
msg | |
} | |
} | |
rule hello_world { | |
select when echo hello | |
send_directive("say", {"something": "Hello World"}) | |
} | |
rule hello_monkey { | |
select when echo monkey | |
pre { | |
name = event:attr("name").klog("using name attribute") | |
|| "Monkey".klog("using default name") | |
} | |
send_directive("say", {"something": "Hello " + name}) | |
} | |
rule hello_monkey_ternary { | |
select when echo monkeyTernary | |
pre { | |
name = event:attr("name") | |
=> event:attr("name").klog("using name attribute") | |
| "Monkey".klog("using default name") | |
} | |
send_directive("say", {"something": "Hello " + name}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment