class Noteikumi

A light weight rule engine

Visit github.com/ripienaar/noteikumi for more information

Constants

VERSION

Public Class Methods

new_engine(path, logger) click to toggle source

Helper to create a new {Engine}

@param path [String] a File::PATH_SEPARATOR seperated list of paths to load rules from @param logger [Logger] a logger to use @return [Engine]

# File lib/noteikumi.rb, line 34
def self.new_engine(path, logger)
  Engine.new(path, logger)
end
rule(rule_name, &blk) click to toggle source

Helper to create a new rule from a block

@param rule_name [String,Symbol] unique name for this rule, Symbols preferred @param blk [Proc] the rule body with access to methods on {Rule} @return [Rule]

# File lib/noteikumi.rb, line 21
def self.rule(rule_name, &blk)
  rule = Rule.new(rule_name)

  rule.instance_eval(&blk)

  rule
end