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: quick_sort.rb
    path of file: ./repos/Algorithms/Sorting/quickSort/Ruby
    
    the code of the file until where you have to start completion: def partition(array, low, high)
    pivot = array[high] # Selecting the last element of the array as the pivot element
    
    idx = low - 1 # Rightful index of the pivot element

    
def partition(array, low, high)
    pivot = array[high] # Selecting the last element of the array as the pivot element
    
    idx = low - 1 # Rightful index of the pivot element

    for counter in low..high
        if array[counter] < pivot
            idx = idx + 1
            array[counter], array[idx] = array[idx], array[counter]
        end