module FormattedTimes

Constants

VERSION

Public Class Methods

define_formats(formats) click to toggle source
# File lib/formatted_times.rb, line 8
def self.define_formats(formats)
  return false unless formats.is_a? Hash
  formats.each do |name, format|
    ActiveSupport::TimeWithZone.instance_eval {
      define_method name.to_sym do
        strftime(format)
      end
    }
  end
end