Class: Commenter::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/commenter/parser.rb,
lib/commenter/parser/osd_xlsx_parser.rb,
lib/commenter/parser/track_change_docx_parser.rb

Defined Under Namespace

Classes: OsdXlsxParser, TrackChangeDocxParser

Instance Method Summary collapse

Instance Method Details

#parse(input_path, options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/commenter/parser.rb', line 12

def parse(input_path, options = {})
  format = detect_format(input_path, options)

  case format
  when :docx
    parse_docx(input_path, options)
  when :xlsx
    parse_xlsx(input_path, options)
  when :redline
    parse_redline(input_path, options)
  else
    raise "Unsupported file format: #{input_path}. Supported formats: .docx, .xlsx"
  end
end