{"id":2629,"date":"2009-12-24T12:01:34","date_gmt":"2009-12-24T16:01:34","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/n1zyy\/?p=2629"},"modified":"2009-12-24T12:01:34","modified_gmt":"2009-12-24T16:01:34","slug":"holiday-wishes","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/n1zyy\/2009\/12\/24\/holiday-wishes\/","title":{"rendered":"Holiday Wishes"},"content":{"rendered":"<p>Some people object to the phrase &#8220;Happy Holidays,&#8221; so I did this instead.\n<code>\nwishes = []<\/p>\n<h1>If someone celebrates no holidays, we need to<\/h1>\n<h1>make sure we have a blank array and not nil<\/h1>\n<p>reader.holidays_celebrated ||= []<\/p>\n<h1>We can't lump these together because some people celebrate more than one holiday.<\/h1>\n<p>if reader.holidays_celebrated.include?(Christmas)\nwishes << \"Merry Christmas\"\nend<\/p>\n<h1>It's transliterated a few different ways so try to include several<\/h1>\n<p>if reader.holidays_celebrated.include?(Hanukkah) || reader.holidays_celebrated.include?(\u05d7\u05e0\u05d5\u05db\u05d4) || reader.holidays_celebrated.include?(Chanukah)<\/p>\n<h1>I think they're already a few weeks in, but whatever<\/h1>\n<p>wishes << \"Happy Hanukkah\"\nend<\/p>\n<p>if reader.holidays_celebrated.include?(Kwanzaa)\nwishes << \"Happy Kwanzaa\"\nend<\/p>\n<p>if reader.holidays_celebrated.include?(Festivus)\nwishes << \"Happy Festivus (for the rest of us)\"\nend<\/p>\n<h1>This goes for everyone, but we want it at the end so the formatting is right<\/h1>\n<p>wishes << \"Happy New Year\"<\/p>\n<h1>The holiday greetings:<\/h1>\n<p><h1><%= wishes.join(' and ') %><\/h1>\n<\/code><\/p>\n<p>That&#8217;s really not ideal. I think I&#8217;d probably prefer to iterate over a hashmap with holidays and the greetings, so that the code would be much cleaner. <\/p>","protected":false},"excerpt":{"rendered":"<p>Some people object to the phrase &#8220;Happy Holidays,&#8221; so I did this instead. wishes = [] If someone celebrates no holidays, we need to make sure we have a blank array and not nil reader.holidays_celebrated ||= [] We can&#8217;t lump &hellip; <a href=\"https:\/\/blogs.n1zyy.com\/n1zyy\/2009\/12\/24\/holiday-wishes\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2629","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/2629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/comments?post=2629"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/2629\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/media?parent=2629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/categories?post=2629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/tags?post=2629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}