class

Bindgen::ConfigReader::ConditionEvaluator

Inherits Reference < Object

Implements the condition evaluation logic of Parser.

See Parsers documentation for a description of the syntax.

You can sub-class this and pass an instance into a Parser if you want to augment its feature-set.

Constants

RX = /^(?:els)?if(?: +|_)(.+?)(?: +|_)(is|isnt|matches|newer_or|older_or)(?: +|_)(.*)$/

Regular expression for conditionals. Matches: [els]if VARIABLE (is|matches) VALUE. Instead of a space, an underscore may be used instead.

Constructors

new(variables : Hash(String, String))
Source

Instance methods

conditional?(text : String) : Bool

Returns true if the text looks like a condition. This is used to feed all keys in a mapping into.

Source
evaluate(condition_text : String, state : ConditionState) : Tuple(Bool, ConditionState)

Evaluates condition_text.

Source
read_verb(text : String) : Verb | Nil

Reads the conditional verb from text, if any.

Source
variables

Accessible variables

Source

Nested types