class SpellingAlphabet::Converter

Text converter which holds the given word set (conversion table).

Public Class Methods

new(word_set = SpellingAlphabet::ITU) click to toggle source

Generates an instance.

# File lib/spelling_alphabet/converter.rb, line 9
def initialize(word_set = SpellingAlphabet::ITU)
  @word_set = word_set
end

Public Instance Methods

interpret(text) click to toggle source

Converts each word to the original letter.

# File lib/spelling_alphabet/converter.rb, line 19
def interpret(text)
  @word_set.interpret(text)
end
spellout(text) click to toggle source

Converts each letter to the corresponding word.

# File lib/spelling_alphabet/converter.rb, line 14
def spellout(text)
  @word_set.spellout(text)
end