class PhoneNumberValidator

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

Public Class Methods

validate_phone_number(phone_number) click to toggle source

Validates any United States phone number!

Example:

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

Output:

=> '+1 (949) 355-6244 ext. 198842' is a valid phone number.'
=> true

Arguments:

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