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: vendor.rb
    path of file: ./repos/SalorHospitality/salor-hospitality/app/models
    
    the code of the file until where you have to start completion: # Copyright (c) 2012 Red (E) Tools Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
    
  def Vendor.to_csv(objects, klass, attributes)
    attrs = attributes.split(";")
    formatstring = ""
    attrs.each do |a|
      #puts "ATTR #{ klass.to_s}: #{ a }"
      cls = klass.columns_hash[a].type if klass.columns_hash[a]
      case cls
      when :integer
        formatstring += "%i;"
      when :datetime, :string, :boolean, :text
        formatstring += "%s;"
      when :float
        formatstring += "%.2f;"
      else
        formatstring += "%s;"
      end
    end