Sha256: 887bb2f4c3999d3011852424444c8a044dde2b7cde8a88bd5ea61d19471d1f3f

Contents?: true

Size: 672 Bytes

Versions: 426

Compression:

Stored size: 672 Bytes

Contents

# Simple Locale tag implementation that computes subtags by simply splitting
# the locale tag at '-' occurences.
module I18n
  module Locale
    module Tag
      class Simple
        class << self
          def tag(tag)
            new(tag)
          end
        end

        include Parents

        attr_reader :tag

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

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

        def to_sym
          tag
        end

        def to_s
          tag.to_s
        end

        def to_a
          subtags
        end
      end
    end
  end
end

Version data entries

426 entries across 372 versions & 78 rubygems

Version Path
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/i18n-0.9.5/lib/i18n/locale/tag/simple.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/i18n-0.9.5/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/i18n-0.9.5/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/locale/tag/simple.rb