Class: Locale::Tag::Irregular

Inherits:
Simple
  • Object
show all
Defined in:
lib/locale/tag/irregular.rb

Overview

Broken tag class.

Constant Summary

Constants inherited from Simple

Simple::ALPHA, Simple::ALPHANUM, Simple::DIGIT, Simple::LANGUAGE, Simple::REGION, Simple::TAG_RE

Instance Attribute Summary

Attributes inherited from Simple

#language, #region, #tag

Instance Method Summary collapse

Methods inherited from Simple

#<=>, #==, #country, #eql?, #hash, #inspect, parse, #to_s, #to_str

Constructor Details

#initialize(tag) ⇒ Irregular

Returns a new instance of Irregular.



20
21
22
23
24
# File 'lib/locale/tag/irregular.rb', line 20

def initialize(tag)
  tag = "en" if tag == nil or tag == ""
  super(tag.to_s)
  @tag = tag
end

Instance Method Details

#candidatesObject

Returns an Array of tag-candidates order by priority.



27
28
29
# File 'lib/locale/tag/irregular.rb', line 27

def candidates
  [Irregular.new(tag)]
end