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

module JsonbAccessor
  module QueryHelper
    # Errors
    InvalidColumnName = Class.n
    
      def convert_time_ranges(attributes)
        attributes.each_with_object({}) do |(name, value), new_attributes|
          is_range = value.is_a?(Range)

          if is_range && (value.first.is_a?(Time) || value.first.is_a?(Date))
            start_time = value.first
            end_time = value.end
            new_attributes[name] = { before: end_time, after: start_time }
          else
            new_attributes[name] = value
          end
        end