Class: BCP47::Region

Inherits:
Subtag show all
Defined in:
lib/bcp47/region.rb

Constant Summary collapse

DEFINITIONS_FILE =
"#{File.dirname(__FILE__)}/../../data/iso-3166-1.yml"

Instance Attribute Summary

Attributes inherited from Subtag

#code

Class Method Summary collapse

Methods inherited from Subtag

#==, all, codes, default, find, #full_name, #initialize, #name

Constructor Details

This class inherits a constructor from BCP47::Subtag

Class Method Details

.identify(full_code) ⇒ Object



4
5
6
# File 'lib/bcp47/region.rb', line 4

def self.identify(full_code)
  full_code =~ /[-_]([A-Z]{2})$/ ? find($1) : nil
end