fork(6) download
  1. def handle(switch)
  2. case switch
  3. when 'a',
  4. print(switch << 'a')
  5. when 'n',
  6. print(switch.sub!('b','n'))
  7. when 'q',
  8. print(switch.gsub('b','q'))
  9. when 'b',
  10. nil
  11. else
  12. print('s!')
  13. end
  14. end
  15.  
  16. handle('b')
Success #stdin #stdout 0.01s 7456KB
stdin
Standard input is empty
stdout
bananas!