TMPでcase ref: http://qiita.com/minamiyama1994/items/b8f1185ed93b6835c239