Sha256: 68c803bfef46e9d4fd9663d56dbb5e10b3adabe00588c19e2f4718754c32e45f
Contents?: true
Size: 688 Bytes
Versions: 7
Compression:
Stored size: 688 Bytes
Contents
## # Defines all available locales. module Anoubis::Core::Locales # List of all possible locales. LIST = { ru: { id: 1, name: 'Russian' }, en: { id: 2, name: 'English' }, kz: { id: 3, name: 'Kazakh' } }.freeze class << self ## # Returns the title of chosen locale # @param key [String] identificator of locale ('ru', 'en', etc.) # @return [String] english title of locale def name(key) LIST[key.to_sym][:name] end ## # Converts list of locales into enum attribute # @return [Symbol] return symbols array for all locales. def enums LIST.reduce({}) { |res, v| res.merge("#{v.first}": v.last[:id]) } end end end
Version data entries
7 entries across 7 versions & 1 rubygems