Class: Rentlinx::PhoneValidator
- Inherits:
-
BaseValidator
- Object
- BaseValidator
- Rentlinx::PhoneValidator
- Defined in:
- lib/rentlinx/validators/phone_validator.rb
Overview
Validator for phone numbers
Instance Attribute Summary
Attributes inherited from BaseValidator
Instance Method Summary collapse
-
#processed_value ⇒ Object
Validates and normalizes the phone number.
Methods inherited from BaseValidator
Constructor Details
This class inherits a constructor from Rentlinx::BaseValidator
Instance Method Details
#processed_value ⇒ Object
Validates and normalizes the phone number
5 6 7 8 9 |
# File 'lib/rentlinx/validators/phone_validator.rb', line 5 def processed_value return '' if value_blank? return @value unless valid? @value.gsub(/[\+\(\)\s\-]/, '') end |