class Punchblock::Translator::DTMFRecognizer::BuiltinMatcherCache

Public Instance Methods

get(uri) click to toggle source
# File lib/punchblock/translator/dtmf_recognizer.rb, line 10
def get(uri)
  cache[uri] ||= fetch(uri)
end

Private Instance Methods

cache() click to toggle source
# File lib/punchblock/translator/dtmf_recognizer.rb, line 21
def cache
  @cache ||= {}
end
fetch(uri) click to toggle source
# File lib/punchblock/translator/dtmf_recognizer.rb, line 16
def fetch(uri)
  grammar = RubySpeech::GRXML.from_uri(uri)
  RubySpeech::GRXML::Matcher.new(grammar)
end