Sha256: 3108a2c4ad681050b16720d60c1eb9dbf01a1288364352f13bfb61cb3fb5c942
Contents?: true
Size: 727 Bytes
Versions: 8
Compression:
Stored size: 727 Bytes
Contents
# encoding: utf-8 require 'i18n/locale/tag/parents' # 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
8 entries across 8 versions & 4 rubygems