<commit_before>module BitBalloon
  class CollectionProxy
    include Enumerable

    attr_accessor :client, :prefix

    def self.path(value = nil)
      return @path unless value
      @path = value
    end

    def self.model(value = nil)
      @model ||= BitBalloon.const_get(to_s.split("::").last.sub(/s$/, ''))
    end

    def initialize(client, prefix = nil)
      self.client = client
      self.prefix = prefix
    end

    def all(options = {})
      response = client.request(:get, [prefix, path].compact.join("/"), options)
      response.parsed.map {|attributes| model.new(client, attributes) } if response.parsed
    end

    def each(&block)
      all.each(&block)
    end

    def get(id)
      response = client.request(:get, ::File.join(path, id))
      model.new(client, response.parsed) if response.parsed
    end

    def create(attributes)
      response = client.request(:post, path, attributes)
      model.new(client, response.parsed) if response.parsed
    end

    def model
      self.class.model
    end

    def path
      self.class.path
    end
  end
end<commit_msg>Make sure custom parameters gets passed to query for collection.all<commit_after>module BitBalloon
  class CollectionProxy
    include Enumerable

    attr_accessor :client, :prefix

    def self.path(value = nil)
      return @path unless value
      @path = value
    end

    def self.model(value = nil)
      @model ||= BitBalloon.const_get(to_s.split("::").last.sub(/s$/, ''))
    end

    def initialize(client, prefix = nil)
      self.client = client
      self.prefix = prefix
    end

    def all(options = {})
      response = client.request(:get, [prefix, path].compact.join("/"), {:params => options})
      response.parsed.map {|attributes| model.new(client, attributes) } if response.parsed
    end

    def each(&block)
      all.each(&block)
    end

    def get(id)
      response = client.request(:get, ::File.join(path, id))
      model.new(client, response.parsed) if response.parsed
    end

    def create(attributes)
      response = client.request(:post, path, attributes)
      model.new(client, response.parsed) if response.parsed
    end

    def model
      self.class.model
    end

    def path
      self.class.path
    end
  end
end
{'fraction_non_alphanumeric': 0.11577551922227132, 'fraction_numerical': 0.0, 'mean_word_length': 2.6108452950558214, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 4, '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': '7300725', 'n_tokens_mistral': 696, 'n_tokens_neox': 682, 'n_words': 177}