class Arachnid::Rules(T)

Overview

The Rules class represents collections of acceptance and rejection rules, which are used to filter data.

Defined in:

arachnid/rules.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(accept : Array(Proc(T?, Bool) | T | Regex | String)? = nil, reject : Array(Proc(T?, Bool) | T | Regex | String)? = nil) #

Creates a new Rules object.


[View source]

Instance Method Detail

def accept : Array(Proc(T?, Bool) | T | Regex | String) #

Accept rules


[View source]
def accept=(value) #

[View source]
def accept?(data : T) #

Determines whether the data should be accepted or rejected.


[View source]
def reject : Array(Proc(T?, Bool) | T | Regex | String) #

Reject rules


[View source]
def reject=(value) #

[View source]
def reject?(data : T) #

Determines whether the data should be rejected or accepted.


[View source]