Sha256: dfdfe03a299a34eccb1818ee0f80f7d1cc3e646dc6a2b16510281d5f3e8522b9
Contents?: true
Size: 679 Bytes
Versions: 12
Compression:
Stored size: 679 Bytes
Contents
# frozen_string_literal: true module FFaker module NatoAlphabet extend ModuleUtils extend self STOP_CODE = 'STOP' CODES = ALPHABET_CODES + NUMERIC_CODES + [STOP_CODE] def code fetch_sample(CODES) end def alphabetic_code fetch_sample(ALPHABET_CODES) end def numeric_code fetch_sample(NUMERIC_CODES) end def callsign codify('?-?-#') end def codify(masks) masks.scan(/./).map do |c| case c when '#' then fetch_sample(NUMERIC_CODES) when '?' then fetch_sample(ALPHABET_CODES) when '.' then STOP_CODE else c end end.join end end end
Version data entries
12 entries across 12 versions & 1 rubygems