title: Ruby: How to find out if a character is a letter or a digit?
body: <p>I just started tinkering with Ruby earlier this week and I've run into something that I don't quite know how to code. I'm converting a scanner that was written in Java into Ruby for a class assignment, and I've gotten down to this section:</p>
  
  <pre><code>if (Character.isLetter(lookAhead))
  {      
      return id();
  }
  
  if (Character.isDigit(lookAhead))
  {
      return number();
  }
  </code></pre>
  
  <p><code>lookAhead</code> is a single character picked out of the string (moving by one space each time it loops through) and these two methods determine if it is a character or a digit, returning the appropriate token type. I haven't been able to figure out a Ruby equivalent to <code>Character.isLetter()</code> and <code>Character.isDigit()</code>.</p>