class Sources::CLDR::Subdivision

Auxiliary Subdivision class to support loading Unicode CLDR data to update local files

def code

def code
  type[2..].upcase
end

def country_code

def country_code
  type[0..1].upcase
end

def initialize(language_code:, xml:)

def initialize(language_code:, xml:)
  @language_code = language_code
  @xml = xml
end

def text

def text
  xml.text
end

def to_h

def to_h
  data = {}
  data['translations'] ||= {}
  data['translations'][language_code] = text
  data
end

def type

def type
  xml.attributes['type'].value.delete('-')
end