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.
17
18
19
|
# File 'lib/i18n/locale/tag/simple.rb', line 17
def initialize(*tag)
@tag = tag.join('-').to_sym
end
|
Instance Attribute Details
#tag ⇒ Object
Returns the value of attribute tag.
15
16
17
|
# File 'lib/i18n/locale/tag/simple.rb', line 15
def tag
@tag
end
|
Class Method Details
.tag(tag) ⇒ Object
8
9
10
|
# File 'lib/i18n/locale/tag/simple.rb', line 8
def tag(tag)
new(tag)
end
|
Instance Method Details
21
22
23
|
# File 'lib/i18n/locale/tag/simple.rb', line 21
def subtags
@subtags = tag.to_s.split('-').map!(&:to_s)
end
|
#to_a ⇒ Object
33
34
35
|
# File 'lib/i18n/locale/tag/simple.rb', line 33
def to_a
subtags
end
|
#to_s ⇒ Object
29
30
31
|
# File 'lib/i18n/locale/tag/simple.rb', line 29
def to_s
tag.to_s
end
|
#to_sym ⇒ Object
25
26
27
|
# File 'lib/i18n/locale/tag/simple.rb', line 25
def to_sym
tag
end
|