Have an external file, wordlist.rb
, that contains
code_words = { 'a' => 'is a', 'b' => 'is b' }
This file is stored in the same directory that contains my code
require 'wordlist
'
code_word.each do | mykey, mysentence | puts mykey + "=> " mysentence end
when I run this code, I get the following message
<main>': undefined local variable or method code_words' for main:Object (NameError)
thanks for the help