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

require 'base64'

module RailsCursorPagination
  # Cursor class that's used to uniquely id
    
      def decode(encoded_string:, order_field: :id)
        decoded = JSON.parse(Base64.strict_decode64(encoded_string))
        if order_field == :id
          if decoded.is_a?(Array)
            raise InvalidCursorError,
                  "The given cursor `#{encoded_string}` was decoded as " \
                  "`#{decoded}` but could not be parsed"
          end