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: string_builder.rb
    path of file: ./repos/ice_cube/lib/ice_cube/builders
    
    the code of the file until where you have to start completion: module IceCube
  class StringBuilder
   
    
    def to_s
      string = @base || ""
      @types.each do |type, segments|
        if (f = self.class.formatter(type))
          current = f.call(segments)
        else
          next if segments.empty?
          current = self.class.sentence(segments)
        end
        f = IceCube::I18n.t("ice_cube.string.format")[type] ? type : "default"
        string = IceCube::I18n.t("ice_cube.string.format.#{f}", rest: string, current: current)
      end