title: How to use "gets" and "gets.chomp" in Ruby
body: <p>I learned that <code>gets</code> creates a new line and asks the user to input something, and <code>gets.chomp</code> does the same thing except that it does not create a new line. <code>gets</code> must return an object, so you can call a method on it, right? If so, lets name that object returned by <code>gets</code> as <code>tmp</code>, then you can call the <code>chomp</code> method of <code>tmp</code>. But before <code>gets</code> returns <code>tmp</code>, it should print a new line on the screen. So what does <code>chomp</code> do? Does it remove the new line <strong>after the <code>gets</code> created it?</strong></p>
  
  <p>Another way to re-expound my question is: Are the following actions performed when I call <code>gets.chomp</code>?</p>
  
  <ol>
  <li><code>gets</code> prints a new line</li>
  <li><code>gets</code> returns <code>tmp</code></li>
  <li><code>tmp.chomp</code> removes the new line</li>
  <li>User input</li>
  </ol>
  
  <p>Is this the right order?</p>