Class: Locale::Tag::Illegular

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

Overview

Broken tag class.

Constant Summary

Constants inherited from Simple

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

Constants included from Util::Memoizable

Util::Memoizable::MEMOIZED_IVAR

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

Methods included from Util::Memoizable

#clear, #freeze, #freeze_without_memoizable, included, #memoize

Constructor Details

#initialize(tag) ⇒ Illegular

Returns a new instance of Illegular.



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

def initialize(tag)
  tag = "en" if tag == nil || tag.empty?
  @language = tag
  @tag = tag
end

Instance Method Details

#candidatesObject

Returns an Array of tag-candidates order by priority.



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

def candidates
  [Illegular.new(tag)]
end