Class: Locale::Info::Region

### Home Classes Methods

### In Files

- lib/locale/info/region.rb

### Parent

Object

### Methods

- ::new
- #iso_region?
- #to_s

### Class/Module Index

Quicksearch

- Locale
- Locale::Driver
- Locale::Driver::CGI
- Locale::Driver::Env
- Locale::Driver::Env::Private
- Locale::Driver::JRuby
- Locale::Driver::Posix
- Locale::Driver::Win32
- Locale::Driver::Win32::Kernel32
- Locale::Driver::Win32Table
- Locale::Info
- Locale::Info::Language
- Locale::Info::Region
- Locale::Middleware
- Locale::Tag
- Locale::Tag::Cldr
- Locale::Tag::Common
- Locale::Tag::Irregular
- Locale::Tag::Posix
- Locale::Tag::Rfc
- Locale::Tag::Simple
- Locale::TagList

No matching classes.

# Locale::Info::Region

This class models out a region/country from the ISO 3166 standard for region codes. In ISO3166, it's called "Country" but Ruby/Locale the word "Region" instead.

### Attributes

code[R]
name[R]

### Public Class Methods

new(code, name) click to toggle source

code | The 2 or 3 digit ISO 3166 region code.
name | The name of the region.

    # File lib/locale/info/region.rb, line 24
    def initialize(code, name)
      @code = code
      @name = name
    end

### Public Instance Methods

iso_region?() click to toggle source

    # File lib/locale/info/region.rb, line 29
    def iso_region?
      @@regions[code] != nil
    end

to_s() click to toggle source

    # File lib/locale/info/region.rb, line 33
    def to_s
      "#{code}"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.