-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sample.art
39 lines (30 loc) · 902 Bytes
/
sample.art
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
define :sampleValidator is :validator [
;------------------
; parameters
;------------------
; override the `params` dictionary key
; in case you want to define validator-specific params
;------------------
; built-in data
;------------------
; any private data that you want
; the validator to have access to
;------------------
; methods
;------------------
action: method [str, opts][
; main action
]
test: method [][
#[
valid: [
; here we have to add valid cases
; that will return *true* when passed to our main action
]
invalid: [
; here we have to add invalid cases
; that will return *false* when passed to our main action
]
]
]
]