<commit_before>require "httparty"
require "json"
require "ostruct"
require "rodzilla/version"
require "rodzilla/resource/base"
require "rodzilla/resource/product"
require "rodzilla/resource/bugzilla"

module Rodzilla
  class WebService

    attr_accessor :base_url, :username, :password, :format 

    def initialize(base_url, username, password)
      @base_url = base_url
      @username = username
      @password = password
      @format   = :json
    end

    def bugzilla_resource(resource)
      raise Rodzilla::ResourceNotFoundError, "Error: #{resource} not found." unless Rodzilla::Resource.constants.include?(resource.to_sym)
      klass = Object.module_eval("Rodzilla::Resource::#{resource}").new(@base_url, @username, @password, @format)
    end

    def products
      bugzilla_resource('Product')
    end

    def bugzilla
      bugzilla_resource('Bugzilla')
    end


  end<commit_msg>Add classifications accessible from WebService<commit_after>require "httparty"
require "json"
require "ostruct"
require "rodzilla/version"
require "rodzilla/resource/base"
require "rodzilla/resource/product"
require "rodzilla/resource/bugzilla"

module Rodzilla
  class WebService

    attr_accessor :base_url, :username, :password, :format 

    def initialize(base_url, username, password)
      @base_url = base_url
      @username = username
      @password = password
      @format   = :json
    end

    def bugzilla_resource(resource)
      raise Rodzilla::ResourceNotFoundError, "Error: #{resource} not found." unless Rodzilla::Resource.constants.include?(resource.to_sym)
      klass = Object.module_eval("Rodzilla::Resource::#{resource}").new(@base_url, @username, @password, @format)
    end

    def products
      bugzilla_resource('Product')
    end

    def bugzilla
      bugzilla_resource('Bugzilla')
    end

    def classifications
      bugzilla_resource('Classification')
    end


  end
{'fraction_non_alphanumeric': 0.10167714884696016, 'fraction_numerical': 0.0, 'mean_word_length': 4.050264550264551, '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': '4690307', 'n_tokens_mistral': 589, 'n_tokens_neox': 544, 'n_words': 129}