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: scoped.rb
    path of file: ./repos/occams-record/lib/occams-record/batches/offset_limit
    
    the code of the file until where you have to start completion: module OccamsRecord
  module Batches
    module OffsetLimit
      #
      # Implements batched loading for ActiveRecord model scopes.
      #
      class Scoped
        def initialize(model, scope, use: nil, query_logger: nil, eager_lo
    
        def run_batches(y, of, append_order_by = nil)
          limit = @scope.limit_value
          batch_size = limit && limit < of ? limit : of

          offset = @scope.offset_value || 0
          out_of_records, count = false, 0
          order_by =
            if append_order_by
              append_order_by.to_s == @model.primary_key.to_s ? append_order_by.to_sym : append_order_by
            end