Module: Valideez::Common
Instance Method Summary collapse
Instance Method Details
#validate_format ⇒ Object
3 4 5 |
# File 'lib/valideez/common.rb', line 3 def validate_format not (format =~ val).nil? end |
#validate_length ⇒ Object
7 8 9 10 11 |
# File 'lib/valideez/common.rb', line 7 def validate_length # length can be a Fixnum or Array of Fixnums lengths = length.kind_of?(Array) ? length : [length] lengths.include? val.size end |