class Arachnid::Rules(T)
- Arachnid::Rules(T)
- Reference
- Object
Overview
The Rules
class represents collections of acceptance and rejection
rules, which are used to filter data.
Defined in:
arachnid/rules.crConstructors
-
.new(accept : Array(Proc(T?, Bool) | T | Regex | String)? = nil, reject : Array(Proc(T?, Bool) | T | Regex | String)? = nil)
Creates a new
Rules
object.
Instance Method Summary
-
#accept : Array(Proc(T?, Bool) | T | Regex | String)
Accept rules
- #accept=(value)
-
#accept?(data : T)
Determines whether the data should be accepted or rejected.
-
#reject : Array(Proc(T?, Bool) | T | Regex | String)
Reject rules
- #reject=(value)
-
#reject?(data : T)
Determines whether the data should be rejected or accepted.
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.