class ISO3166::Country
def parse_attributes(attribute, val)
def parse_attributes(attribute, val) fail "Invalid attribute name '#{attribute}'" unless AttrReaders.include?(attribute.to_sym) attributes = Array(attribute.to_s) if attributes == ['name'] attributes << 'names' # TODO: Revisit when better data from i18n_data # attributes << 'translated_names' end val = (val.is_a?(Regexp) ? Regexp.new(val.source, 'i') : val.to_s.downcase) [attributes, val] end