I cannot get my def function to recognize the hash(dictionary) that comes before it. I'm familiar with Python and cannot get the same thing to work with Ruby.
Here is my error:
./engEsp.rb:12:in translate': undefined local variable or methodnumHash'
for main:Object (NameError)
from ./engEsp.rb:19:in `'
Here is the program...
#!/usr/bin/env ruby
system "clear"
numHash = {}
def translate
print "Number in English: "
eng = gets.chomp
print "Numero en Espanol: "
esp = gets.chomp
numHash[eng] = esp
puts "Data has been added!"
puts numHash
translate
end
translate