Sha256: 3f54380330982011ec84825d51dd7b8c42eaf944cf053aafc26e45066c60ce89

Contents?: true

Size: 461 Bytes

Versions: 1

Compression:

Stored size: 461 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tunecore-announcer-0.1.0 lib/tunecore-announcer/command_dictionary.rb