title: Ruby a clever way to execute a function on a condition
body: <p>As a bit of a fun project I'm implementing a Beatnik interpreter in Ruby. If you've never heard of Beatnik it's an esoteric programming language in which operations are specified by the "scrabble score" of the words in the source code.</p>
  
  <p>Anyway, the implementation requires a different operation to happen for different scrabble scores. This isn't particularly to implement, one obvious ways is an if statement:</p>
  
  <pre><code>if score == 1
  ...
  elsif score == 2
  ...
  else
  ...
  end
  </code></pre>
  
  <p>Another way would be to use a case statement:</p>
  
  <pre><code>case score
  when 1
    ...
  when 2
    ...
  else
    ...
  end
  </code></pre>
  
  <p>But neither of these two methods strikes me as particularly elegant, can you suggest an alternative way of implementing this?</p>