class PhoneNumberValidator

This class is the master/parent class to all of the validation functionality

Public Class Methods

validate(phone_number) click to toggle source

Validates any United States phone number!

Example:

PhoneNumberValidator.validate('+1 (949) 355-6244 ext. 198842')

Output:

=> true

Arguments:

phone_number: (String)
# File lib/phone_number_validator.rb, line 17
def validate(phone_number)
  validator = Validator.new(phone_number)
  validator.validate
end