Class: ClickatellApiClient::TelephoneNumber::UsNumberValidator
- Inherits:
-
Object
- Object
- ClickatellApiClient::TelephoneNumber::UsNumberValidator
- Defined in:
- lib/clickatell_api_client/telephone_number/us_number_validator.rb
Constant Summary collapse
- US_PHONE_NUMBER_REGEXP =
/^\+1\d{10}$/
Instance Attribute Summary collapse
-
#telephone ⇒ Object
readonly
Returns the value of attribute telephone.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(telephone) ⇒ UsNumberValidator
constructor
A new instance of UsNumberValidator.
Constructor Details
#initialize(telephone) ⇒ UsNumberValidator
Returns a new instance of UsNumberValidator.
8 9 10 |
# File 'lib/clickatell_api_client/telephone_number/us_number_validator.rb', line 8 def initialize(telephone) @telephone = telephone end |
Instance Attribute Details
#telephone ⇒ Object (readonly)
Returns the value of attribute telephone.
6 7 8 |
# File 'lib/clickatell_api_client/telephone_number/us_number_validator.rb', line 6 def telephone @telephone end |
Instance Method Details
#call ⇒ Object
12 13 14 |
# File 'lib/clickatell_api_client/telephone_number/us_number_validator.rb', line 12 def call !!US_PHONE_NUMBER_REGEXP.match(telephone) end |