Sha256: 33f494276f40daf1a87766e963d780c1b473f3712a293388fa9295d24358a244
Contents?: true
Size: 517 Bytes
Versions: 12
Compression:
Stored size: 517 Bytes
Contents
# frozen_string_literal: true module FFaker module Locale extend ModuleUtils extend self def code(given_language = nil) code_index = LANGUAGE.index(given_language) return LANGUAGE_CODE[code_index] if given_language && code_index fetch_sample(LANGUAGE_CODE) end def language(given_code = nil) language_index = LANGUAGE_CODE.index(given_code&.upcase) return LANGUAGE[language_index] if given_code && language_index fetch_sample(LANGUAGE) end end end
Version data entries
12 entries across 12 versions & 1 rubygems