Class: VAProfile::Models::BaseAddress
- Includes:
- Concerns::Defaultable, Concerns::Expirable
- Defined in:
- lib/va_profile/models/base_address.rb
Direct Known Subclasses
Constant Summary collapse
- VALID_ALPHA_REGEX =
/[a-zA-Z ]+/
- VALID_NUMERIC_REGEX =
/[0-9]+/
- ADDRESS_FIELD_LIMIT =
35
- RESIDENCE =
'RESIDENCE/CHOICE'
- CORRESPONDENCE =
'CORRESPONDENCE'
- ADDRESS_POUS =
[RESIDENCE, CORRESPONDENCE].freeze
- DOMESTIC =
'DOMESTIC'
- INTERNATIONAL =
'INTERNATIONAL'
- MILITARY =
'OVERSEAS MILITARY'
- ADDRESS_TYPES =
[DOMESTIC, INTERNATIONAL, MILITARY].freeze
Constants inherited from Base
VAProfile::Models::Base::SOURCE_SYSTEM
Instance Method Summary collapse
Methods included from Concerns::Expirable
#effective_end_date_has_passed
Methods included from Concerns::Defaultable
Instance Method Details
#ascii_only ⇒ Object
126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/va_profile/models/base_address.rb', line 126 def ascii_only address = [ address_line1, address_line2, address_line3, city, province, international_postal_code ].join('') errors.add(:address, 'must contain ASCII characters only') unless address.ascii_only? end |
#zip_plus_four ⇒ Object
139 140 141 142 143 |
# File 'lib/va_profile/models/base_address.rb', line 139 def zip_plus_four return if zip_code.blank? [zip_code, zip_code_suffix].compact.join('-') end |