Project

claus

0.0
No commit activity in last 3 years
No release in over 3 years
simple hash / array based rule matching engine
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
 Project Readme

Claus

Simple rule expression using a combination of Array and Hash.

Example

require 'claus'
claus = Claus.new(foo: 1, bar: 2)
claus.match(foo: 1, bar: 2)           #=> true
claus.match(foo: 1, bar: 3)           #=> false
claus.match(foo: 1, bar: 2, baz: 3)   #=> true

claus = Claus.new(foo: 1, bar: 1..2)
claus.match(foo: 1, bar: 2)           #=> true

claus = Claus.new([{foo:1}, {bar:2}])
claus.match?(foo: 1)                  #=> true
claus.match?(bar: 2)                  #=> true
claus.match?(baz: 3)                  #=> false

License

Creative Commons Attribution - CC BY