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: paginator.rb
    path of file: ./repos/json_api_client/lib/json_api_client/paginating
    
    the code of the file until where you have to start completion: module JsonApiClient
  module Paginating
    class Paginator
      class_attribute :page_param,
                      :per_page_param

      self.page_param = "page"
      self.per_page_param = "per_page"

      attr_reader :params,
    
      def total_pages
        if links["last"]
          uri = result_set.links.link_url_for("last")
          last_params = params_for_uri(uri)
          last_params.fetch(page_param) do
            current_page
          end.to_i
        else
          current_page
        end
      end