Validation as a Utility
Validation as a Utility
3/5
#
Make
it
Flexable
rmq
.validation
.valid
?(
'test'
, :length,
exact_length
:
4
)
#true
rmq
.validation
.valid
?(
'test'
, :length,
min_length
:
4
)
#true
rmq
.validation
.valid
?(
'test'
, :length,
max_length
:
4
)
#true
rmq
.validation
.valid
?(
'test'
, :length,
min_length
:
2
,
max_length
:
7
)
#true
rmq
.validation
.valid
?(
'test'
, :length,
exact_length
:
2
..
7
)
#true
rmq
.validation
.valid
?(
' test '
, :length,
max_length
:
5
,
strip
: true)
#true