app/models/form_profile.rb
# returns the veteran's phone number as an object
# preference: vet360 mobile -> vet360 home -> pciu
returns the veteran's phone number as an object
preference: vet360 mobile -> vet360 home -> pciu
returns the veteran ' s phone number as an object preference : vet360 mobile - > vet360 home - > pciu
def phone_object
    mobile = vet360_contact_info&.mobile_phone
    return mobile if mobile&.area_code && mobile&.phone_number
    home = vet360_contact_info&.home_phone
    return home if home&.area_code && home&.phone_number
    phone_struct = Struct.new(:area_code, :phone_number)
    return phone_struct.new(pciu_us_phone.first(3), pciu_us_phone.last(7)) if pciu_us_phone&.length == 10
    phone_struct.new
  end
def phone_object mobile = vet360_contact_info &. mobile_phone return mobile if mobile &. area_code && mobile &. phone_number home = vet360_contact_info &. home_phone return home if home &. area_code && home &. phone_number phone_struct = Struct . new ( :area_code , :phone_number ) return phone_struct . new ( pciu_us_phone . first ( 3 ) , pciu_us_phone . last ( 7 ) ) if pciu_us_phone &. length == 10 phone_struct . new end
returns the veteran's phone number as an object
preference: vet360 mobile -> vet360 home -> pciu
returns the veteran ' s phone number as an object preference : vet360 mobile - > vet360 home - > pciu