Ad
  • Default User Avatar

    This is the so called "ternary operator":
    http://www.w3resource.com/ruby/ruby-ternary-operator.php

    condition ? something : something-else
    

    is a shortcut for:

    if condition
      something
    else
      something-else
    end
    
  • Default User Avatar

    Nice one, but I believe the description could use some improvements - specifically, I think it should be more specific about the argument names.

    There's no information indicating whether the argument names should be extracted from the value (as the usage example might imply) or fixed arg names should be used (as the test cases seem to indicate).

    I'm guessing the latter was the original intent, but seeing how most solutions focus on parsing the values, the description definitely is not clear enough in this regard.