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: url_text.rb
    path of file: ./repos/boxcars/lib/boxcars/boxcar
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Boxcars
  # A Boxcar that reads text from a URL.
  class URLText < Boxcar
    # the description of this boxcar
    DESC = "useful when you want to get text from a URL."

    # implements a boxcar that uses the Google SerpAPI to get answers to questions.
    # @param name [String] The name of the 
    
    def get_answer(url)
      response = Net::HTTP.get_response(url)
      if response.is_a?(Net::HTTPSuccess)
        return Result.from_text(response.body) if response.content_type == "text/plain"

        if response.content_type == "text/html"
          # return only the top level text
          txt = html_to_text(url, response)
          Result.from_text(txt)
        else
          Result.from_text(response.body)
        end