Class: EVSS::PCIU::PhoneNumber
- Defined in:
- lib/evss/pciu/phone_number.rb
Overview
Model for PCIU phone numbers
Instance Attribute Summary collapse
-
#country_code ⇒ String
The country code at the beginning of the phone number.
-
#effective_date ⇒ DateTime
Date at which the number was known to be valid.
-
#extension ⇒ String
The extension at the end of the phone number.
-
#number ⇒ String
The main phone number, digits only.
Instance Attribute Details
#country_code ⇒ String
Returns The country code at the beginning of the phone number.
19 20 21 22 23 24 25 26 27 |
# File 'lib/evss/pciu/phone_number.rb', line 19 class PhoneNumber < BaseModel attribute :country_code, String attribute :number, String attribute :extension, String attribute :effective_date, DateTime validates :number, presence: true validates :number, format: { with: /\A\d+\z/, message: 'Only numbers are permitted.' } end |
#effective_date ⇒ DateTime
Returns Date at which the number was known to be valid.
19 20 21 22 23 24 25 26 27 |
# File 'lib/evss/pciu/phone_number.rb', line 19 class PhoneNumber < BaseModel attribute :country_code, String attribute :number, String attribute :extension, String attribute :effective_date, DateTime validates :number, presence: true validates :number, format: { with: /\A\d+\z/, message: 'Only numbers are permitted.' } end |
#extension ⇒ String
Returns The extension at the end of the phone number.
19 20 21 22 23 24 25 26 27 |
# File 'lib/evss/pciu/phone_number.rb', line 19 class PhoneNumber < BaseModel attribute :country_code, String attribute :number, String attribute :extension, String attribute :effective_date, DateTime validates :number, presence: true validates :number, format: { with: /\A\d+\z/, message: 'Only numbers are permitted.' } end |
#number ⇒ String
Returns The main phone number, digits only.
19 20 21 22 23 24 25 26 27 |
# File 'lib/evss/pciu/phone_number.rb', line 19 class PhoneNumber < BaseModel attribute :country_code, String attribute :number, String attribute :extension, String attribute :effective_date, DateTime validates :number, presence: true validates :number, format: { with: /\A\d+\z/, message: 'Only numbers are permitted.' } end |