<commit_before>class Vigor
  class ChampionStats
    attr_accessor :champions, :modify_date

    def initialize(data)
      @champions = data['champions'].map { |champion| ChampionAggregate.new(champion) }
      @modify_date = DateTime.strptime((data['modifyDate']/1000).to_s, '%s')
    end

  end

  class ChampionAggregate # rename this, tired atm ><
    attr_accessor :stats, :name, :id

    def initialize(data)
      @stats = data['stats']
      @id = data['id']
      @name = data['name']
    end

  end
end<commit_msg>Added Enumerable and [] to ChampionStats<commit_after>class Vigor
  class ChampionStats
    attr_accessor :champions, :modify_date
    include Enumerable

    def initialize(data)
      @champions = data['champions'].map { |champion| ChampionAggregate.new(champion) }
      @modify_date = DateTime.strptime((data['modifyDate']/1000).to_s, '%s')
    end

    def combined
      @champions.last.stats
    end

    def each(&block)
      @champions.each do |champion|
        block.call(champion)
      end
    end

    def [](key)
      if key.kind_of?(Integer)
        return @champions[key]
      else
        return (@champions.find { |champ| champ.name.casecmp(key) == 0 }).stats
      end
    end
  end

  class ChampionAggregate # rename this, tired atm ><
    attr_accessor :stats, :name, :id

    def initialize(data)
      @stats = data['stats']
      @id = data['id']
      @name = data['name']
    end

  end
end
{'fraction_non_alphanumeric': 0.12240663900414937, 'fraction_numerical': 0.006224066390041493, 'mean_word_length': 2.8689839572192515, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5295522', 'n_tokens_mistral': 492, 'n_tokens_neox': 481, 'n_words': 110}