File: region.rb

package info (click to toggle)
ruby-iso 0.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 196 kB
  • sloc: ruby: 364; makefile: 4
file content (13 lines) | stat: -rw-r--r-- 260 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
class ISO::Region < ISO::Subtag
  DEFINITIONS_FILE   = "#{File.dirname(__FILE__)}/../../data/iso-3166-1.yml"

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

private

  def i18n_scope
    super << ".regions"
  end
end