Array
This provides the subclass of Array which behaves like the first(top priority) Locale::Tag object. “Locale.current.language” is same with “Locale.current[0].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[0] or Locale.candidates to find the current locale instead of this function.
Returns the top priority charset. (posix)
# File lib/locale/taglist.rb, line 48
48: def charset
49: if self[0].respond_to? :charset
50: self[0].charset
51: else
52: ::Locale.driver_module.charset
53: end
54: end
Returns the top priority region/country. (simple)
# File lib/locale/taglist.rb, line 36
36: def country
37: self[0].region
38: end
Returns the top priority extensions.(common, rfc, cldr)
# File lib/locale/taglist.rb, line 70
70: def extensions
71: (self[0].respond_to? :extensions) ? self[0].extensions : nil
72: end
Returns the top priority language. (simple)
# File lib/locale/taglist.rb, line 32
32: def language
33: self[0].language
34: end
Returns the top priority modifier. (posix)
# File lib/locale/taglist.rb, line 58
58: def modifier
59: (self[0].respond_to? :modifier) ? self[0].modifier : nil
60: end
Returns the top priority privateuse(rfc)
# File lib/locale/taglist.rb, line 76
76: def privateuse
77: (self[0].respond_to? :privateuse) ? self[0].privateuse : nil
78: end
Returns the top priority region/country. (simple)
# File lib/locale/taglist.rb, line 40
40: def region
41: self[0].region
42: end
Returns the top priority script. (common)
# File lib/locale/taglist.rb, line 44
44: def script
45: self[0].script
46: end
# File lib/locale/taglist.rb, line 101
101: def to_cldr
102: self[0].to_cldr
103: end
# File lib/locale/taglist.rb, line 89
89: def to_common
90: self[0].to_common
91: end
# File lib/locale/taglist.rb, line 105
105: def to_posix
106: self[0].to_posix
107: end
# File lib/locale/taglist.rb, line 97
97: def to_rfc
98: self[0].to_rfc
99: end
# File lib/locale/taglist.rb, line 85
85: def to_s
86: self[0].to_s
87: end
# File lib/locale/taglist.rb, line 93
93: def to_simple
94: self[0].to_simple
95: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.