Sha256: 5a7d0922b547beb7f90f55edd2365a25d937a36c0d6d7899a6cbc49c73702bad
Contents?: true
Size: 691 Bytes
Versions: 154
Compression:
Stored size: 691 Bytes
Contents
# encoding: utf-8 # 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
154 entries across 94 versions & 8 rubygems