title: How to cleanly verify if the user input is an integer in Ruby?
body: <p>I have a piece of code where I ask the user to input a number as an answer to my question.
  I can do <code>to_i</code> but tricky/garbage inputs would escape through <code>to_i</code>. For example, if a user inputs <code>693iirum5</code> as an answer then #to_i would strip it to <code>693</code>.</p>
  
  <p>Please suggest a function, not a regular expression.
  Thanks in advance for replying.</p>