{"id":134,"date":"2009-02-18T14:23:36","date_gmt":"2009-02-18T19:23:36","guid":{"rendered":"http:\/\/hoolihan.net\/blog-tim\/?p=134"},"modified":"2009-05-29T08:30:11","modified_gmt":"2009-05-29T13:30:11","slug":"simple-string-extension-in-ruby","status":"publish","type":"post","link":"http:\/\/hoolihan.net\/blog-tim\/2009\/02\/18\/simple-string-extension-in-ruby\/","title":{"rendered":"Simple String Extension in Ruby"},"content":{"rendered":"<p>Based on a <a href=\"http:\/\/steve.yegge.googlepages.com\/lisp-wins\">blog post from Steve Yegge&#8230;<\/a><\/p>\n<pre>#ruby\r\nclass String\r\n   def endswith(arg)\r\n     (self =~ \/.*#{arg}$\/) != nil\r\n   end\r\nend\r\n\r\n#to test\r\nirb&gt;\"extension\".endswith(\"ion\")<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Based on a blog post from Steve Yegge&#8230; #ruby class String def endswith(arg) (self =~ \/.*#{arg}$\/) != nil end end #to test irb&gt;&#8221;extension&#8221;.endswith(&#8220;ion&#8221;)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,16],"tags":[70,69,271],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-programming","category-ruby","tag-class-extensions","tag-linkedin","tag-ruby"],"_links":{"self":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":0,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"wp:attachment":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}