From: Kaye Ng Date: 2010-06-06T16:20:48+09:00 Subject: Please explain this "Why's" example please I'm reading Why's Poignant Guide to Ruby. I don't understand this example. -------------------------------------------------------- require 'wordlist' # Get evil idea and swap in code words print "Enter your new idea: " idea = gets code_words.each do |real, code| idea.gsub!( real, code ) end --------------------------------------------------------- I'm assuming that, if I run the program, there would be a message on the screen that says "Enter your new idea:" and a text box for me to type something. After I type a word (and press an 'OK' button?), then what? Can anyone explain to me the role of Gets here? And also the Each block please. You may also give me another example with Gets and Each. Explain it to me as if I'm a moron please. No big words, no complicated programming terms, none of that. I'm a beginner. Thanks so much for your time. =) -- Posted via http://www.ruby-forum.com/.