require 'yaml' class TunecoreAnnouncer::CommandDictionary attr_reader :dictionary def initialize(yaml_filename) @logger = TunecoreAnnouncer::Logger.instance load_dictionary(yaml_filename) end def load_dictionary(yaml_filename) @logger.info "Loading command dictionary: #{yaml_filename}" @dictionary = YAML.load_file(yaml_filename) @logger.debug @dictionary.inspect end def lookup(message) @dictionary[message] end end