Sha256: 24faebfea892d5b49e0637ff135b8ea22e7ee3f52c94b753a1cda5bec158f8d6

Contents?: true

Size: 419 Bytes

Versions: 22

Compression:

Stored size: 419 Bytes

Contents

module ETL #:nodoc:
  module Transform #:nodoc:
    # Transform a String representation of a date to a Date instance
    class StringToDateTransform < ETL::Transform::Transform
      # Transform the value using Date.parse
      def transform(name, value, row)
        return value if value.nil?
        begin
          Date.parse(value)
        rescue => e
          return value
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 9 rubygems

Version Path
aeden-activewarehouse-etl-0.9.1 etl/lib/etl/transform/string_to_date_transform.rb
colincasey-activewarehouse-etl-0.9.4 lib/etl/transform/string_to_date_transform.rb
colincasey-activewarehouse-etl-0.9.5 lib/etl/transform/string_to_date_transform.rb
factorylabs-activewarehouse-etl-0.9.1.2 lib/etl/transform/string_to_date_transform.rb
factorylabs-activewarehouse-etl-0.9.1.3 lib/etl/transform/string_to_date_transform.rb
factorylabs-activewarehouse-etl-0.9.1.4 lib/etl/transform/string_to_date_transform.rb
factorylabs-activewarehouse-etl-0.9.1.5 lib/etl/transform/string_to_date_transform.rb
factorylabs-activewarehouse-etl-0.9.1.6 lib/etl/transform/string_to_date_transform.rb
factorylabs-activewarehouse-etl-0.9.1.7 lib/etl/transform/string_to_date_transform.rb
jayzes-activewarehouse-etl-0.9.1.1 lib/etl/transform/string_to_date_transform.rb
jayzes-activewarehouse-etl-0.9.1.2 lib/etl/transform/string_to_date_transform.rb
jayzes-activewarehouse-etl-0.9.1 lib/etl/transform/string_to_date_transform.rb
activewarehouse-etl-1.0.0 lib/etl/transform/string_to_date_transform.rb
activewarehouse-etl-1.0.0.rc1 lib/etl/transform/string_to_date_transform.rb
etl-0.9.5.rc1 lib/etl/transform/string_to_date_transform.rb
activewarehouse-etl-sgonyea-0.9.6 lib/etl/transform/string_to_date_transform.rb
activewarehouse-etl-0.9.5.rc1 lib/etl/transform/string_to_date_transform.rb
darrell-activewarehouse-etl-0.9.1.6 lib/etl/transform/string_to_date_transform.rb
darrell-activewarehouse-etl-0.9.1.4 lib/etl/transform/string_to_date_transform.rb
factorylabs-activewarehouse-etl-0.9.1.8 lib/etl/transform/string_to_date_transform.rb