{"id":56,"date":"2008-01-13T21:40:13","date_gmt":"2008-01-14T05:40:13","guid":{"rendered":"http:\/\/fernyb.net\/blog\/2008\/01\/13\/ruby-code-snippet\/"},"modified":"2008-01-13T21:40:13","modified_gmt":"2008-01-14T05:40:13","slug":"ruby-code-snippet","status":"publish","type":"post","link":"http:\/\/fernyb.net\/blog\/2008\/01\/13\/ruby-code-snippet\/","title":{"rendered":"Ruby Code Snippet"},"content":{"rendered":"<p>\nIn Ruby a switch statement looks like this\n<\/p>\n<pre lang=\"ruby\" line=\"1\">\r\nsay = \"Hello\"\r\n\r\ncase say\r\nwhen \"Hello\" then\r\n\tputs \"Say Hello\"\r\nwhen \"Bye\" then\r\n\tputs \"Say Bye\"\r\nend\r\n<\/pre>\n<p>\nIn PHP a switch statement looks like this\n<\/p>\n<pre lang=\"php\" line=\"1\">\r\n<?php\r\n\r\n$say = \"Hello\";\r\n\r\nswitch($say) {\r\ncase \"Hello\" :\r\n\techo \"Say Hello\";\r\nbreak;\r\ncase \"Bye\" :\r\n\techo \"Say Bye\";\r\nbreak;\r\n}\r\n\r\n?>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In Ruby a switch statement looks like this say = &#8220;Hello&#8221; case say when &#8220;Hello&#8221; then puts &#8220;Say Hello&#8221; when &#8220;Bye&#8221; then puts &#8220;Say Bye&#8221; end In PHP a switch statement looks like this<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,21],"tags":[],"_links":{"self":[{"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/posts\/56"}],"collection":[{"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":0,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"wp:attachment":[{"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}