Class: Cure::Transformation::TransformResult
- Inherits:
-
Object
- Object
- Cure::Transformation::TransformResult
- Includes:
- Helpers::FileHelpers
- Defined in:
- lib/cure/transformation/transform.rb
Instance Attribute Summary collapse
-
#column_headers ⇒ Object
Returns the value of attribute column_headers.
-
#row_count ⇒ Object
Returns the value of attribute row_count.
-
#transformed_rows ⇒ Object
Returns the value of attribute transformed_rows.
Instance Method Summary collapse
- #add_transformed_row(row) ⇒ Object
- #extract_column_headers(row) ⇒ Object
-
#initialize ⇒ TransformResult
constructor
A new instance of TransformResult.
Methods included from Helpers::FileHelpers
#clean_dir, #read_file, #with_file, #with_temp_dir
Constructor Details
#initialize ⇒ TransformResult
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_headers ⇒ Object
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_count ⇒ Object
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_rows ⇒ Object
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
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 |