<commit_before>module Clever
  module APIOperations
    # Represents a page of data
    class Page
      include Enumerable

      attr_accessor :paging
      attr_accessor :links

      def initialize(uri, filters = {})
        @uri = uri
        @filters = filters

        response = Clever.request :get, uri, filters
        @list = Util.convert_to_clever_object response[:data]
        @paging = response[:paging]
        @links = {}
        response[:links].each do |link|
          @links[link[:rel].to_sym] = link[:uri]
        end
      end

      # Gets next page if one is present, nil otherwise.
      def next
        @links.key?(:next) ? Page.new(@links[:next]) : nil
      end

      def each(&blk)
        @list.each(&blk)
      end

      # TODO: remove this
      def all
        accum = []
        each do |elem|
          accum << elem
        end
        accum
      end
    end
  end
end<commit_msg>remove paging object, remove accessors<commit_after>module Clever
  module APIOperations
    # Represents a page of data
    class Page
      include Enumerable

      def initialize(uri, filters = {})
        @uri = uri
        @filters = filters

        response = Clever.request :get, uri, filters
        @list = Util.convert_to_clever_object response[:data]
        @links = {}
        response[:links].each do |link|
          @links[link[:rel].to_sym] = link[:uri]
        end
      end

      # Gets next page if one is present, nil otherwise.
      def next
        @links.key?(:next) ? Page.new(@links[:next]) : nil
      end

      def each(&blk)
        @list.each(&blk)
      end

      # TODO: remove this
      def all
        accum = []
        each do |elem|
          accum << elem
        end
        accum
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09577464788732394, 'fraction_numerical': 0.0, 'mean_word_length': 1.7449768160741885, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2256898', 'n_tokens_mistral': 521, 'n_tokens_neox': 513, 'n_words': 153}