Sha256: ebeaa7377573cdbd8ceb55954e7bb9a3bfa4a52bd3a75012bd19c0ad3c04db5f
Contents?: true
Size: 536 Bytes
Versions: 6
Compression:
Stored size: 536 Bytes
Contents
# encoding: utf-8 module Faker module Locale extend ModuleUtils extend self def code(given_language = nil) code_index = LANGUAGE.index(given_language) if given_language && code_index LANGUAGE_CODE[code_index] else LANGUAGE_CODE.sample end end def language(given_code = nil) language_index = LANGUAGE_CODE.index(given_code.upcase) if given_code && language_index LANGUAGE[language_index] else LANGUAGE.sample end end end end
Version data entries
6 entries across 6 versions & 2 rubygems