Sha256: 1dd1e807d8f35047435d07b8139893db2cec4541a67f037226281702d5ba2d20

Contents?: true

Size: 656 Bytes

Versions: 29

Compression:

Stored size: 656 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!(&: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

29 entries across 27 versions & 9 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/i18n-1.10.0/lib/i18n/locale/tag/simple.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/i18n-1.10.0/lib/i18n/locale/tag/simple.rb
i18n-1.10.0 lib/i18n/locale/tag/simple.rb
i18n-1.9.1 lib/i18n/locale/tag/simple.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/i18n-1.8.11/lib/i18n/locale/tag/simple.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/i18n-1.8.11/lib/i18n/locale/tag/simple.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/i18n-1.8.11/lib/i18n/locale/tag/simple.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/i18n-1.8.11/lib/i18n/locale/tag/simple.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/i18n-1.8.11/lib/i18n/locale/tag/simple.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/i18n-1.8.10/lib/i18n/locale/tag/simple.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/tag/simple.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/tag/simple.rb
i18n-1.8.11 lib/i18n/locale/tag/simple.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/i18n-1.8.10/lib/i18n/locale/tag/simple.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/i18n-1.8.10/lib/i18n/locale/tag/simple.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/i18n-1.8.10/lib/i18n/locale/tag/simple.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/i18n-1.8.5/lib/i18n/locale/tag/simple.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/i18n-1.8.10/lib/i18n/locale/tag/simple.rb
i18n-1.8.10 lib/i18n/locale/tag/simple.rb
i18n-1.8.9 lib/i18n/locale/tag/simple.rb