Class: I18n::Locale::Tag::Simple
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Parents
#parent, #parents, #self_and_parents
Constructor Details
#initialize(*tag) ⇒ Simple
Returns a new instance of Simple.
22
23
24
|
# File 'lib/vendor/i18n/lib/i18n/locale/tag/simple.rb', line 22
def initialize(*tag)
@tag = tag.join('-').to_sym
end
|
Instance Attribute Details
Returns the value of attribute tag.
20
21
22
|
# File 'lib/vendor/i18n/lib/i18n/locale/tag/simple.rb', line 20
def tag
@tag
end
|
Class Method Details
13
14
15
|
# File 'lib/vendor/i18n/lib/i18n/locale/tag/simple.rb', line 13
def tag(tag)
new(tag)
end
|
Instance Method Details
26
27
28
|
# File 'lib/vendor/i18n/lib/i18n/locale/tag/simple.rb', line 26
def subtags
@subtags = tag.to_s.split('-').map { |subtag| subtag.to_s }
end
|
38
39
40
|
# File 'lib/vendor/i18n/lib/i18n/locale/tag/simple.rb', line 38
def to_a
subtags
end
|
34
35
36
|
# File 'lib/vendor/i18n/lib/i18n/locale/tag/simple.rb', line 34
def to_s
tag.to_s
end
|
30
31
32
|
# File 'lib/vendor/i18n/lib/i18n/locale/tag/simple.rb', line 30
def to_sym
tag
end
|