lib/va_profile/models/address.rb
# Converts a decoded JSON response from VAProfile to an instance of the Address model
# @param body [Hash] the decoded response body from VAProfile
# @return [VAProfile::Models::Address] the model built from the response body
# rubocop:disable Metrics/MethodLength
Converts a decoded JSON response from VAProfile to an instance of the Address model
Converts a decoded JSON response from VAProfile to an instance of the Address model
def in_json
        address_attributes = {
          addressId: @id,
          addressLine1: @address_line1,
          addressLine2: @address_line2,
          addressLine3: @address_line3,
          addressPOU: @address_pou,
          addressType: @address_type.titleize,
          cityName: @city,
          countryCodeISO2: @country_code_iso2,
          countryCodeISO3: @country_code_iso3,
          countryName: @country_name,
          county: {
            countyCode: @county_code,
            countyName: @county_name
          },
          intPostalCode: @international_postal_code,
          provinceName: @province,
          stateCode: @state_code,
          zipCode5: @zip_code,
          zipCode4: @zip_code_suffix,
          originatingSourceSystem: SOURCE_SYSTEM,
          sourceSystemUser: @source_system_user,
          sourceDate: @source_date,
          vet360Id: @vet360_id,
          effectiveStartDate: @effective_start_date,
          effectiveEndDate: @effective_end_date
        }
        if @validation_key.present?
          address_attributes[:validationKey] = @validation_key
          address_attributes[:overrideIndicator] = true
        end
        {
          bio: address_attributes
        }.to_json
      end
def in_json address_attributes = { addressId : @id , addressLine1 : @address_line1 , addressLine2 : @address_line2 , addressLine3 : @address_line3 , addressPOU : @address_pou , addressType : @address_type . titleize , cityName : @city , countryCodeISO2 : @country_code_iso2 , countryCodeISO3 : @country_code_iso3 , countryName : @country_name , county : { countyCode : @county_code , countyName : @county_name } , intPostalCode : @international_postal_code , provinceName : @province , stateCode : @state_code , zipCode5 : @zip_code , zipCode4 : @zip_code_suffix , originatingSourceSystem : SOURCE_SYSTEM , sourceSystemUser : @source_system_user , sourceDate : @source_date , vet360Id : @vet360_id , effectiveStartDate : @effective_start_date , effectiveEndDate : @effective_end_date } if @validation_key . present? address_attributes [ :validationKey ] = @validation_key address_attributes [ :overrideIndicator ] = true end { bio : address_attributes } . to_json end
Converts a decoded JSON response from VAProfile to an instance of the Address model
Converts a decoded JSON response from VAProfile to an instance of the Address model
the model built from the response body rubocop:disable Metrics/MethodLength
the model built from the response body rubocop : disable Metrics / MethodLength
VAProfile::Models::Address
body
the decoded response body from VAProfile
the decoded response body from VAProfile