Class: Aidp::Planning::Parsers::FeedbackDataParser

Inherits:
Object
  • Object
show all
Defined in:
lib/aidp/planning/parsers/feedback_data_parser.rb

Overview

Parse feedback data from multiple formats (CSV, JSON, markdown) Normalizes data into consistent structure for analysis

Defined Under Namespace

Classes: FeedbackParseError

Instance Method Summary collapse

Constructor Details

#initialize(file_path:) ⇒ FeedbackDataParser

Returns a new instance of FeedbackDataParser.



15
16
17
18
# File 'lib/aidp/planning/parsers/feedback_data_parser.rb', line 15

def initialize(file_path:)
  @file_path = file_path
  @format = detect_format
end

Instance Method Details

#parseHash

Parse feedback file and return normalized structure

Returns:

  • (Hash)

    Normalized feedback data



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/aidp/planning/parsers/feedback_data_parser.rb', line 22

def parse
  Aidp.log_debug("feedback_data_parser", "parsing", file: @file_path, format: @format)

  case @format
  when :csv
    parse_csv
  when :json
    parse_json
  when :markdown
    parse_markdown
  else
    raise FeedbackParseError, "Unsupported format: #{@format}"
  end
rescue => e
  Aidp.log_error("feedback_data_parser", "parse_failed", error: e.message, file: @file_path)
  raise FeedbackParseError, "Failed to parse feedback file: #{e.message}"
end