module I18n::Locale::Tag::Parents - i18n-0.6.11 Documentation

# module I18n::Locale::Tag::Parents

### Public Instance Methods

parent() click to toggle source

    # File lib/i18n/locale/tag/parents.rb, line 5
    def parent
      @parent ||= begin
        segs = to_a.compact
        segs.length > 1 ? self.class.tag(*segs[0..(segs.length-2)].join('-')) : nil
      end
    end

parents() click to toggle source

    # File lib/i18n/locale/tag/parents.rb, line 16
    def parents
      @parents ||= ([parent] + (parent ? parent.parents : [])).compact
    end

self_and_parents() click to toggle source

    # File lib/i18n/locale/tag/parents.rb, line 12
    def self_and_parents
      @self_and_parents ||= [self] + parents
    end