You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: report_headers_builder.rb
    path of file: ./repos/openfoodnetwork/lib/reporting
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Reporting
  class ReportHeadersBuilder
  
    
    def fields_to_show
      fields_in_headers = if report.display_header_row?
                            report.formatted_rules.map { |rule|
                              rule[:fields_used_in_header]
                            }.flatten.compact_blank
                          else
                            []
                          end