     @_initValueTransformers options.valueTransformers
     .then (vt) =>
       @_valueTransformers = vt
-      @
+      this
 
   map: (origRow, accRow) ->
     value = if accRow[@_fromCol] then accRow[@_fromCol] else origRow[@_fromCol]


    c = csv().from.stream(csvIn).to.stream(csvOut)
    .transform (row, idx, done) =>
      if idx == 0 and @_options.includesHeaderRow
        headers = row
        newHeaders = @_options.mapping.transformHeader row
        done null, newHeaders
      else
        if idx == 0
          headers = _.map _.range(row.length), (idx) ->
            "#{idx}"

        @_options.mapping.transformRow @_convertToObject(headers, row)
        .then (converted) =>

class ConstantTransformer extends ValueTransformer
  init: (options) ->
    @_value = options.value
    Q(this)

  transform: (value) ->
    @_value

class UpperCaseTransformer extends ValueTransformer
  init: (options) ->
    Q(this)

  transform: (value) ->
    value.toUpperCase()

class LowerCaseTransformer extends ValueTransformer
  init: (options) ->
    Q(this)

  transform: (value) ->
    value.toLowerCase()
