Sha256: b53e935e2666a819f0af252ef04194ea889839b5c15b681a63bb7a509b76db6d
Contents?: true
Size: 596 Bytes
Versions: 9
Compression:
Stored size: 596 Bytes
Contents
module ETL #:nodoc: module Transform #:nodoc: # Transform a Date or Time to a formatted string instance class DateToStringTransform < ETL::Transform::Transform # Initialize the transformer. # # Configuration options: # * <tt>:format</tt>: A format passed to strftime. Defaults to %Y-%m-%d def initialize(control, name, configuration={}) super @format = configuration[:format] || "%Y-%m-%d" end # Transform the value using strftime def transform(name, value, row) value.strftime(@format) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems