Class: I18n::Locale::Tag::Simple

Inherits:
Object
  • Object
show all
Includes:
Parents
Defined in:
activesupport/lib/active_support/vendor/i18n-0.3.7/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

- (Simple) initialize(*tag)



19
20
21
# File 'activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb', line 19

def initialize(*tag)
  @tag = tag.join('-').to_sym
end

Instance Attribute Details

- (Object) tag (readonly)

Returns the value of attribute tag



17
18
19
# File 'activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb', line 17

def tag
  @tag
end

Class Method Details

+ (Object) tag(tag)



10
11
12
# File 'activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb', line 10

def tag(tag)
  new(tag)
end

Instance Method Details

- (Object) subtags



23
24
25
# File 'activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb', line 23

def subtags
  @subtags = tag.to_s.split('-').map { |subtag| subtag.to_s }
end

- (Object) to_a



35
36
37
# File 'activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb', line 35

def to_a
  subtags
end

- (Object) to_s



31
32
33
# File 'activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb', line 31

def to_s
  tag.to_s
end

- (Object) to_sym



27
28
29
# File 'activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb', line 27

def to_sym
  tag
end