<commit_before>require 'rest-client'
require 'json'
require 'forwardable'

class Seaweed::HTTP
  class << self
    extend Forwardable

    def configure(http: RestClient, json: JSON)
      @http = http
      @json = json
    end

    def parse(json)
      @json.parse json, symbolize_names: true
    end

    def_delegators :@http, :get, :put, :post, :delete
  end
end<commit_msg>http documentation<commit_after>require 'rest-client'
require 'json'
require 'forwardable'

class Seaweed::HTTP
  class << self
    extend Forwardable

    def_delegators :@http, :get, :put, :post, :delete

    # inject your own rest client or json parser
    #
    # @param RestClient http
    # @param JSON json

    def configure(http: RestClient, json: JSON)
      @http = http
      @json = json
    end

    # JSON parse with default symbolized keys
    #
    # @param String json
    # @return Hash

    def parse(json)
      @json.parse json, symbolize_names: true
    end
  end
end
{'fraction_non_alphanumeric': 0.09278350515463918, 'fraction_numerical': 0.0, 'mean_word_length': 2.8685258964143427, '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': '5174241', 'n_tokens_mistral': 311, 'n_tokens_neox': 300, 'n_words': 99}