Sha256: 1e0626f9584eb10c4b35f7ef60e8827098d69e84fc7370c3f26fde431c61b80c
Contents?: true
Size: 681 Bytes
Versions: 9
Compression:
Stored size: 681 Bytes
Contents
# frozen_string_literal: true module FFakerTW 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
9 entries across 9 versions & 1 rubygems