lib/NATO/parser.rb in NATO-0.0.3 vs lib/NATO/parser.rb in NATO-0.1.0

- old
+ new

@@ -1,11 +1,16 @@ -require 'singleton' +require "singleton" +require_relative "dictionary" -class NATO::Parser - include Singleton +module NATO + class Parser + include Singleton - def natify(text) - text.split('').map do |piece| - NATO::DICTIONARY[piece.to_sym] + def natify(text) + text.split("").map do |piece| + DICTIONARY.fetch piece.downcase.to_sym + end end + + alias_method :to_nato, :natify end -end \ No newline at end of file +end