Sha256: d416d0cee6abc295886ba8615003a6e7a776ff9ec3cba66a87d7605080681b7d

Contents?: true

Size: 317 Bytes

Versions: 20

Compression:

Stored size: 317 Bytes

Contents

require 'forwardable'

module Fasterer
  class OffenseCollector
    extend Forwardable

    def initialize
      @offenses = []
    end

    def [](offense_name)
      @offenses.select { |offense| offense.name == offense_name }
    end

    def_delegators :@offenses, :push, :any?, :each, :group_by, :count
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
fasterer-0.11.0 lib/fasterer/offense_collector.rb
fasterer-0.10.1 lib/fasterer/offense_collector.rb
fasterer-0.10.0 lib/fasterer/offense_collector.rb
fasterer-0.9.0 lib/fasterer/offense_collector.rb
fasterer-0.8.3 lib/fasterer/offense_collector.rb
fasterer-0.8.2 lib/fasterer/offense_collector.rb
fasterer-0.8.1 lib/fasterer/offense_collector.rb
fasterer-0.8.0 lib/fasterer/offense_collector.rb
fasterer-0.7.1 lib/fasterer/offense_collector.rb
fasterer-0.7.0 lib/fasterer/offense_collector.rb
fasterer-0.6.0 lib/fasterer/offense_collector.rb
fasterer-0.5.1 lib/fasterer/offense_collector.rb
fasterer-0.5.0 lib/fasterer/offense_collector.rb
fasterer-0.4.2 lib/fasterer/offense_collector.rb
fasterer-0.4.1 lib/fasterer/offense_collector.rb
fasterer-0.4.0 lib/fasterer/offense_collector.rb
fasterer-0.3.2 lib/fasterer/offense_collector.rb
fasterer-0.3.1 lib/fasterer/offense_collector.rb
fasterer-0.3.0 lib/fasterer/offense_collector.rb
fasterer-0.2.1 lib/fasterer/offense_collector.rb