Parent

Included Modules

Locale::TagList

This provides the subclass of Array which behaves like the first(top priority) Locale::Tag object. "Locale.current.language" is same with "Locale.current.language".

Locale.current returns an Array of Tag(s) now. But the old Locale.current(Ruby-GetText) and Locale.get returns Locale::Object (similier with Locale::Tag::Posix). This is the class for backward compatibility.

It is recommanded to use Locale.current or Locale.candidates to find the current locale instead of this function.

Public Instance Methods

charset() click to toggle source

Returns the top priority charset. (posix)

# File lib/locale/taglist.rb, line 48
def charset
  top_priority_charset = nil
  first_tag = self[0]
  if first_tag.respond_to?(:charset)
    top_priority_charset = first_tag.charset
  end
  top_priority_charset ||= ::Locale.driver_module.charset
  top_priority_charset
end
country() click to toggle source

Returns the top priority region/country. (simple)

# File lib/locale/taglist.rb, line 36
def country
  self[0].region
end
extensions() click to toggle source

Returns the top priority extensions.(common, rfc, cldr)

# File lib/locale/taglist.rb, line 72
def extensions
  (self[0].respond_to? :extensions) ? self[0].extensions : nil
end
language() click to toggle source

Returns the top priority language. (simple)

# File lib/locale/taglist.rb, line 32
def language
  self[0].language
end
modifier() click to toggle source

Returns the top priority modifier. (posix)

# File lib/locale/taglist.rb, line 60
def modifier
  (self[0].respond_to? :modifier) ? self[0].modifier : nil
end
privateuse() click to toggle source

Returns the top priority privateuse(rfc)

# File lib/locale/taglist.rb, line 78
def privateuse
  (self[0].respond_to? :privateuse) ? self[0].privateuse : nil
end
region() click to toggle source

Returns the top priority region/country. (simple)

# File lib/locale/taglist.rb, line 40
def region
  self[0].region
end
script() click to toggle source

Returns the top priority script. (common)

# File lib/locale/taglist.rb, line 44
def script
  self[0].script
end
to_cldr() click to toggle source
# File lib/locale/taglist.rb, line 103
def to_cldr
  self[0].to_cldr
end
to_common() click to toggle source
# File lib/locale/taglist.rb, line 91
def to_common
  self[0].to_common
end
to_posix() click to toggle source
# File lib/locale/taglist.rb, line 107
def to_posix
  self[0].to_posix
end
to_rfc() click to toggle source
# File lib/locale/taglist.rb, line 99
def to_rfc
  self[0].to_rfc
end
to_s() click to toggle source
# File lib/locale/taglist.rb, line 87
def to_s
  self[0].to_s
end
to_simple() click to toggle source
# File lib/locale/taglist.rb, line 95
def to_simple
  self[0].to_simple
end
to_str() click to toggle source
# File lib/locale/taglist.rb, line 83
def to_str
  self[0].to_str
end
variants() click to toggle source

Returns the top priority variants.(common, rfc, cldr)

# File lib/locale/taglist.rb, line 66
def variants
  (self[0].respond_to? :variants) ? self[0].variants : nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.