Sha256: f9998d301e8f252e4e843ce126ae23deb026b2a424195e859b40fcf7f3d58420
Contents?: true
Size: 653 Bytes
Versions: 22
Compression:
Stored size: 653 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) return value unless value.respond_to?(:strftime) value.strftime(@format) end end end end
Version data entries
22 entries across 22 versions & 9 rubygems