Module FormValidator::Constraints
In: formvalidator.rb

Methods

Constants

STATES = [ :AL, :AK, :AZ, :AR, :CA, :CO, :CT, :DE, :FL, :GA, :HI, :ID, :IL, :IN, :IA, :KS, :KY, :LA, :ME, :MD, :MA, :MI, :MN, :MS, :MO, :MT, :NE, :NV, :NH, :NJ, :NM, :NY, :NC, :ND, :OH, :OK, :OR, :PA, :PR, :RI, :SC, :SD, :TN, :TX, :UT, :VT, :VA, :WA, :WV, :WI, :WY, :DC, :AP, :FP, :FPO, :APO, :GU, :VI ]   Valid US state abbreviations.
PROVINCES = [ :AB, :BC, :MB, :NB, :NF, :NS, :NT, :ON, :PE, :QC, :SK, :YT, :YK ]   Valid Canadian province abbreviations.

Public Instance methods

Matches a standard american phone number.

This checks if the input is in the format MM/YY or MM/YYYY and if the MM part is a valid month (1-12) and if that date is not in the past.

The number is checked only for plausibility, it checks if the number could be valid for a type of card by checking the checksum and looking at the number of digits and the number of digits of the number..

This checks to see if the credit card type begins with a M, V, A, or D.

Sloppy matches a valid email address.

This matches a valid IP address(version 4).

Matches a generic phone number.

Matches a Canadian postal code.

Matches a Canadian province.

Matches a US state.

Matches a US state or Canadian province.

Matches a US zipcode.

Matches a Canadian postal code or US zipcode.

[Validate]