Skip to content

Instantly share code, notes, and snippets.

@bscofield
Created August 29, 2011 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bscofield/1178197 to your computer and use it in GitHub Desktop.
Save bscofield/1178197 to your computer and use it in GitHub Desktop.
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