class LUSI::API::Country::Country

Represents a country in the LUSI API

Attributes

iso_alpha2_code[RW]

@!attribute [rw] iso_alpha2_code

@return [String, nil] the ISO alpha-2 code for the country

Public Class Methods

new(xml = nil, lookup = nil, iso_alpha2_code: nil, **kwargs) click to toggle source

Initialises a new Country instance @param (see LUSI::API::Core::Code#initialize) @param iso_alpha2_code [String, nil] the default ISO alpha-2 code for the country @return [void]

Calls superclass method LUSI::API::Core::BasicCode::new
# File lib/lusi_api/country.rb, line 20
def initialize(xml = nil, lookup = nil, iso_alpha2_code: nil, **kwargs)
  super(xml, lookup, **kwargs)
  @iso_alpha2_code = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:ISOAlpha2Code', iso_alpha2_code)
end

Public Instance Methods

to_s() click to toggle source

Returns a string representation of the Country instance @return [String] the string representation of the Country instance

# File lib/lusi_api/country.rb, line 27
def to_s
  @description
end