Created
September 9, 2010 18:55
-
-
Save baldwindavid/572329 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add a layer of abstraction || obfuscation! | |
module Somethingable | |
def self.make(&block) | |
begin | |
return true if block.call | |
rescue | |
return false | |
end | |
end | |
end | |
class Date | |
def self.parseable?(str) | |
Somethingable.make { parse(str) } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment