Sha256: d57e83ba462340978126847ca13911d00349c579cc27bfe705462cf5247eecdf

Contents?: true

Size: 484 Bytes

Versions: 426

Compression:

Stored size: 484 Bytes

Contents

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

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

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

Version data entries

426 entries across 372 versions & 78 rubygems

Version Path
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/i18n-1.1.1/lib/i18n/locale/tag/parents.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/i18n-1.1.1/lib/i18n/locale/tag/parents.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/i18n-1.7.0/lib/i18n/locale/tag/parents.rb
i18n-1.7.0 lib/i18n/locale/tag/parents.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/i18n-1.1.1/lib/i18n/locale/tag/parents.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/i18n-1.1.1/lib/i18n/locale/tag/parents.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/i18n-0.8.0/lib/i18n/locale/tag/parents.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb
spiral_form-0.1.1 vendor/bundle/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb
spiral_form-0.1.0 vendor/bundle/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb
ric-0.13.0 vendor/bundle/ruby/2.5.0/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/i18n-0.9.5/lib/i18n/locale/tag/parents.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/i18n-0.9.5/lib/i18n/locale/tag/parents.rb
ric-0.12.2 vendor/bundle/ruby/2.5.0/gems/i18n-1.6.0/lib/i18n/locale/tag/parents.rb