Module: Valideez::Common

Included in:
Iban, Nip, Pesel, Phone, Regon, Siret
Defined in:
lib/valideez/common.rb

Instance Method Summary collapse

Instance Method Details

#validate_formatObject



3
4
5
# File 'lib/valideez/common.rb', line 3

def validate_format
  not (format =~ val).nil?
end

#validate_lengthObject



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