Method: Cure::Transformation::Transform#transform_content
- Defined in:
- lib/cure/transformation/transform.rb
#transform_content(parsed_content) ⇒ Hash<String,TransformResult>
Returns # make this transformation results?.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/cure/transformation/transform.rb', line 28 def transform_content(parsed_content) parsed_content.content.each_with_object({}) do |section, hash| ctx = TransformResult.new section["rows"].each do |row| ctx.row_count += 1 if ctx.row_count == 1 ctx.extract_column_headers(row) next end row = transform(section["name"], ctx.column_headers, row) ctx.add_transformed_row(row) end hash[section["name"]] = ctx end end |