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: output.rb
    path of file: ./repos/ekylibre/lib/procedo/engine/intervention
    
    the code of the file until where you have to start completion: # require 'procedo/engine/intervention/product_pa
    
        def to_attributes
          hash = super
          hash[:variant_id] = @variant.id if @variant
          hash[:new_name] = @new_name if @new_name.present?
          hash[:identification_number] = @identification_number if @identification_number.present?
          hash[:variety] = @variety if @variety.present?
          hash[:specie_variety_name] = @specie_variety_name if @specie_variety_name.present?
          hash[:batch_number] = @batch_number if @batch_number.present?
          hash
        end