{"url":"https://secret-garden.hatenablog.com/entry/2017/12/03/214333","author_name":"osyo-manga","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecret-garden.hatenablog.com%2Fentry%2F2017%2F12%2F03%2F214333\" title=\"\u3010\u4e00\u4eba Ruby Advent Calendar 2017\u3011case-when \u3068 === \u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u30103\u65e5\u76ee\u3011 - Secret Garden(Instrumental)\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"\u3010\u4e00\u4eba Ruby Advent Calendar 2017\u3011case-when \u3068 === \u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u30103\u65e5\u76ee\u3011","height":"190","description":"\u4e00\u4eba Ruby Advent Calendar 2017 3\u65e5\u76ee\u306e\u8a18\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u3055\u3066\u3001\u4eca\u56de\u306f case \u5f0f\u306e when \u7bc0\u3068 #=== \u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u7c21\u5358\u306b\u89e3\u8aac\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 case \u5f0f \u3055\u3066\u3055\u3066\u3001Ruby \u306e case \u5f0f\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066 when \u7bc0\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3044\u307e\u3059\u3002 def func n case n # n \u306e\u5024\u304c when \u306b\u6e21\u3057\u305f\u5024\u3067\u3042\u308c\u3070\u305d\u306e\u5f0f\u3092\u8a55\u4fa1\u3057\u3066\u8fd4\u3059 when 1 \"one\" when 2 \"two\" when 3 \"three\" else \"other\" end end p (1..5).map &method(:func) # => [\"one\"\u2026","provider_url":"https://hatena.blog","image_url":null,"version":"1.0","categories":["Ruby"],"published":"2017-12-03 21:43:33","width":"100%","blog_url":"https://secret-garden.hatenablog.com/","blog_title":"Secret Garden(Instrumental)","type":"rich","author_url":"https://blog.hatena.ne.jp/osyo-manga/","provider_name":"Hatena Blog"}