Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.22 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def testcase(b1, b2, b3)
  2.   foo, bar = case [b1, b2, b3]
  3.   when ["be", "fr", 1]
  4.     ["koo", "kee"]
  5.   when ["nl", "nl", 1]
  6.     ["goo", "gee"]
  7.   end
  8.   puts "foo => #{foo}, bar => #{bar}"
  9. end
  10.  
  11. testcase("be", "fr", 1)