Skip to content

Instantly share code, notes, and snippets.

Last active Jan 11, 2016
What would you like to do?
rules endpoint
(ns ruru.endpoint.rules
(:require [compojure.core :refer :all]
[clara.rules :refer :all]
[ :refer :all]))
(defrecord Person [name age])
(defrule adult
"Is the person older than 21."
[Person (> 21 age)]
("Is older than 21"))
(defn run-examples
"Rule runner"
(-> (mk-session 'ruru.endpoint.rules)
(insert (->Person "Johnny" 22))
(str " Here is the final")))
(defn rules-endpoint [config]
(GET "/rules" [] (run-examples))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment