class LUSI::API::Country::AddressCountry
Represents the country component of an address in the LUSI
API
Attributes
@!attribute [rw] region
@return [String. nil] the text description of the region of the address
Public Class Methods
Returns AddressCountry
instances matching the supplied parameters @param (see LUSI::API::Country::Country#get_instance) @param iso_alpha2_code [String, nil] the ISO alpha-2 code to search for @param region [String, nil] the region to search for @return [Array<AddressCountry>, nil] the matching AddressCountry
instances @yield [obj] Passes the AddressCountry
instance to the block @yieldparam obj [LUSI::API::Country::AddressCountry] the AddressCountry
instance
LUSI::API::Core::Code::get_instance
# File lib/lusi_api/country.rb, line 48 def self.get_instance(api = nil, lookup = nil, iso_alpha2_code: nil, region: nil, **kwargs) super(api, lookup, 'LUSIReference', 'Lookup.asmx', 'GetAddressCountries', 'xmlns:AddressCountry', iso_alpha2_code: iso_alpha2_code, region: region, **kwargs) end
Initialises a new AddressCountry
instance @param (see Country#initialize) @param region [String, nil] the default region @return [void]
LUSI::API::Country::Country::new
# File lib/lusi_api/country.rb, line 57 def initialize(xml = nil, lookup = nil, region: nil, **kwargs) super(xml, lookup, **kwargs) @region = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Region', region) end
Protected Class Methods
Returns a parameter hash for the LUSI
API
call @params (see get_instance) @return [Hash<String, any] the parameter hash for the LUSI
API
call
LUSI::API::Core::Code::get_instance_params
# File lib/lusi_api/country.rb, line 67 def self.get_instance_params(**kwargs) params = super(**kwargs) params[:ISOAlpha2Code] = kwargs[:iso_alpha2_code] || '' params[:Region] = kwargs[:region] || '' params end