Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
biagiodistefano committed Nov 29, 2024
1 parent b5fee87 commit 0632a96
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,23 +153,6 @@ assert not evaluate(rule, example_false)
You can extend the rule engine by adding new operators.
Use the func operator for custom logic, or modify the `OPERATOR_FUNCTIONS` dictionary for persistent custom operators.

Example with func:

```python
from rule_engine import Rule

# Custom condition: Check if a value is a palindrome
is_palindrome = lambda x: str(x) == str(x)[::-1]

rule = Rule(word__func=is_palindrome)

example_true = {"word": "radar"}
example_false = {"word": "hello"}

assert rule.evaluate(example_true)
assert not rule.evaluate(example_false)
```

## Full example

```python
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "light-rule-engine"
version = "0.2.0"
version = "0.2.1"
description = "A simple rule engine"
authors = ["Biagio Distefano <me@biagiodistefano.io>"]
readme = "README.md"
Expand Down

0 comments on commit 0632a96

Please sign in to comment.