dry-rb / dry-logic

Predicate logic with rule composition
https://dry-rb.org/gems/dry-logic/
MIT License
179 stars 66 forks source link

Fix broken negation example in documentation #112

Open Drenmi opened 6 months ago

Drenmi commented 6 months ago

What is this change?

The existing examples for negation when used verbatim result in the following error:

dry-logic-1.5.0/lib/dry/logic/builder.rb:48:in `instance_eval': wrong number of arguments (given 0, expected 1..3) (ArgumentError)

          instance_eval(&context)
                        ^^^^^^^^

From the error and the test cases it looks like this is intended to be invoked with a block.

This PR updates the documentation with a working example.