<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Jrm02t's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Wed, 20 Aug 2008 20:22:49 GMT</pubDate>
    <description>DZone Snippets: Jrm02t's Code Snippets</description>
    <item>
      <title>Mask all but last 4 digits</title>
      <link>http://snippets.dzone.com/posts/show/3049</link>
      <description>If you need to mask all but the last 4 digits of a nubmer - like a credit card number - this helper works nicely.&lt;br /&gt;&lt;br /&gt;Just pass it a number or string.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;def mask_number(number)&lt;br /&gt;  number.to_s.size &lt; 5 ? number.to_s : (('*' * number.to_s[0..-5].length) + number.to_s[-4..-1])&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 28 Nov 2006 08:51:41 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3049</guid>
      <author>jrm02t ()</author>
    </item>
    <item>
      <title>Check for under age</title>
      <link>http://snippets.dzone.com/posts/show/3048</link>
      <description>This function can be used to check if a user is underage.&lt;br /&gt;&lt;br /&gt;Note: This is using rails core extensions. It'd need to be modified a bit for a pure ruby implementation.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;def underage?(birthday)&lt;br /&gt;  18.years.ago &lt; birthday&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 28 Nov 2006 07:00:07 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3048</guid>
      <author>jrm02t ()</author>
    </item>
  </channel>
</rss>
