Class: Overule::Operator
- Inherits:
-
Object
- Object
- Overule::Operator
- Defined in:
- lib/overule/operator.rb
Overview
Provides comparison operations for rule evaluation Supports various operators like equality, inequality, greater/less than, inclusion, and range checking
Constant Summary collapse
- OPERATORS =
{ "eq" => ->(a, b) { a == b }, "neq" => ->(a, b) { a != b }, "gt" => ->(a, b) { a > b }, "lt" => ->(a, b) { a < b }, "gte" => ->(a, b) { a >= b }, "lte" => ->(a, b) { a <= b }, "in" => ->(a, b) { b.include?(a) }, "nin" => ->(a, b) { !b.include?(a) }, "contains" => ->(a, b) { a.include?(b) }, "range" => ->(a, b) { a >= b.first && a <= b.last } }.freeze