Module: I18n::Locale::Tag::Parents

Included in:
Rfc4646, Simple
Defined in:
activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/parents.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) parent



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

def parent
  @parent ||= begin
    segs = to_a.compact
    segs.length > 1 ? self.class.tag(*segs[0..(segs.length-2)].join('-')) : nil
  end
end

- (Object) parents



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

def parents
  @parents ||= ([parent] + (parent ? parent.parents : [])).compact
end

- (Object) self_and_parents



14
15
16
# File 'activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/parents.rb', line 14

def self_and_parents
  @self_and_parents ||= [self] + parents
end