Created
August 29, 2011 11:13
-
-
Save bscofield/1178197 to your computer and use it in GitHub Desktop.
This file contains 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
module Toolbox | |
module Logger | |
module_function | |
def log(message, priority = :warn) | |
Logger.send(:priority, message) | |
end | |
end | |
module CreditCard | |
module_function | |
def format_cc(number) | |
number.scan(/\d{4}/).join('-') | |
end | |
end | |
module CoreExt | |
module_function | |
module Array | |
def select_random_element(array) | |
array[rand(array.length)] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment