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: number_of_digits.rb
    path of file: ./repos/Ruby/maths
    
    the code of the file until where you have to start completion: # Given a number, find number of digits in it.

def count_digits(n
    
def count_digits(n)
  count = 0
  temp = n

  return 1 if n == 0

  until temp.zero?
    count += 1
    temp /= 10
  end