Class: I18n::Locale::Tag::Simple
- Inherits:
-
Object
- Object
- I18n::Locale::Tag::Simple
show all
- Includes:
- Parents
- Defined in:
- lib/i18n/locale/tag/simple.rb
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.
20
21
22
|
# File 'lib/i18n/locale/tag/simple.rb', line 20
def initialize(*tag)
@tag = tag.join('-').to_sym
end
|
Instance Attribute Details
#tag ⇒ Object
Returns the value of attribute tag.
18
19
20
|
# File 'lib/i18n/locale/tag/simple.rb', line 18
def tag
@tag
end
|
Class Method Details
.tag(tag) ⇒ Object
11
12
13
|
# File 'lib/i18n/locale/tag/simple.rb', line 11
def tag(tag)
new(tag)
end
|
Instance Method Details
24
25
26
|
# File 'lib/i18n/locale/tag/simple.rb', line 24
def subtags
@subtags = tag.to_s.split('-').map { |subtag| subtag.to_s }
end
|
#to_a ⇒ Object
36
37
38
|
# File 'lib/i18n/locale/tag/simple.rb', line 36
def to_a
subtags
end
|
#to_s ⇒ Object
32
33
34
|
# File 'lib/i18n/locale/tag/simple.rb', line 32
def to_s
tag.to_s
end
|
#to_sym ⇒ Object
28
29
30
|
# File 'lib/i18n/locale/tag/simple.rb', line 28
def to_sym
tag
end
|