Ad
  • Custom User Avatar

    I believe it is to do with the readibility. It's almost English !!!

  • Default User Avatar

    I think this code is clever because it is the type of code that is not typically on people's radar when they're first learning to code in Ruby on Rails. I know this because I'm a total newbie at this and the first lessons you learn with Ruby are if/elsif/else statements. Using these if/elsif/else statements is therefore the thing that many newbies will be most inclined to use for an assignment like this. This "when" command followed by a range is not something taught very often in your first classes with Ruby and it is the type of free-and-easy code that belies extensive experience with the language. So my thinking goes.

  • Default User Avatar

    I can't tell you why :( It's just a basic Ruby specific feature, not "Obscure" or "Creative" xD !!

  • Default User Avatar

    Please tell me why this is marked "clever".