Class: VAProfile::Models::BaseAddress
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
#set_defaults
Instance Method Details
#ascii_only ⇒ Object
127
128
129
130
131
132
133
134
135
136
137
138
|
# File 'lib/va_profile/models/base_address.rb', line 127
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
140
141
142
143
144
|
# File 'lib/va_profile/models/base_address.rb', line 140
def zip_plus_four
return if zip_code.blank?
[zip_code, zip_code_suffix].compact.join('-')
end
|