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