Class: Cure::Transformation::TransformResult

Inherits:
Object
  • Object
show all
Includes:
Helpers::FileHelpers
Defined in:
lib/cure/transformation/transform.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::FileHelpers

#clean_dir, #read_file, #with_file, #with_temp_dir

Constructor Details

#initializeTransformResult

Returns a new instance of TransformResult.



81
82
83
84
85
# File 'lib/cure/transformation/transform.rb', line 81

def initialize
  @row_count = 0
  @transformed_rows = []
  @column_headers = {}
end

Instance Attribute Details

#column_headersObject

Returns the value of attribute column_headers.



77
78
79
# File 'lib/cure/transformation/transform.rb', line 77

def column_headers
  @column_headers
end

#row_countObject

Returns the value of attribute row_count.



77
78
79
# File 'lib/cure/transformation/transform.rb', line 77

def row_count
  @row_count
end

#transformed_rowsObject

Returns the value of attribute transformed_rows.



77
78
79
# File 'lib/cure/transformation/transform.rb', line 77

def transformed_rows
  @transformed_rows
end

Instance Method Details

#add_transformed_row(row) ⇒ Object



92
93
94
# File 'lib/cure/transformation/transform.rb', line 92

def add_transformed_row(row)
  @transformed_rows << row
end

#extract_column_headers(row) ⇒ Object

Parameters:

  • row (Array<String>)


88
89
90
# File 'lib/cure/transformation/transform.rb', line 88

def extract_column_headers(row)
  row.each_with_index { |column, idx| @column_headers[column] = idx }
end