class ISO::UN::Region

Constants

DEFINITIONS_FILE

Attributes

iso_code[R]

Public Class Methods

identify(full_code) click to toggle source
# File lib/iso/un/region.rb, line 18
def self.identify(full_code)
  full_code =~ /-(\d{3})$/ ? find($1) : nil
end
new(code, options={}) click to toggle source
Calls superclass method ISO::Subtag::new
# File lib/iso/un/region.rb, line 8
def initialize(code, options={})
  @iso_code = options[:iso_code]
  super(code, options)
end

Public Instance Methods

name() click to toggle source
Calls superclass method ISO::Subtag#name
# File lib/iso/un/region.rb, line 13
def name
  return super if iso_code.nil?
  @options[:name] || I18n.t(iso_code, :scope => i18n_scope)
end