<commit_before>module SearchObject
  module Plugin
    module Paging
      def self.included(base)
        base.extend ClassMethods
      end

      def initialize(options = {})
        @page     = options[:page].to_i.abs
        @per_page = options.fetch(:per_page) { self.class.get_per_page }.to_i.abs

        super options
      end

      def page
        @page
      end

      def per_page
        @per_page
      end

      private

      def fetch_results
        apply_paging super
      end

      def apply_paging(scope)
        scope.limit(per_page).offset(page * per_page)
      end

      module ClassMethods
        def per_page(number)
          @per_page = number.to_i.abs
        end

        def get_per_page
          @per_page ||= 25
        end
      end
    end
  end
end
<commit_msg>Use attr_reader<commit_after>module SearchObject
  module Plugin
    module Paging
      def self.included(base)
        base.extend ClassMethods
      end

      attr_reader :page, :per_page

      def initialize(options = {})
        @page     = options[:page].to_i.abs
        @per_page = options.fetch(:per_page) { self.class.get_per_page }.to_i.abs

        super options
      end

      private

      def fetch_results
        apply_paging super
      end

      def apply_paging(scope)
        scope.limit(per_page).offset(page * per_page)
      end

      module ClassMethods
        def per_page(number)
          @per_page = number.to_i.abs
        end

        def get_per_page
          @per_page ||= 25
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.06704980842911877, 'fraction_numerical': 0.002554278416347382, 'mean_word_length': 1.7017241379310344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '503969', 'n_tokens_mistral': 495, 'n_tokens_neox': 471, 'n_words': 110}