Sha256: e0036e87d7cbeaa04dcf2d64a0f17dd74cb908d38228c5d9065e96f8f52e882f

Contents?: true

Size: 647 Bytes

Versions: 10

Compression:

Stored size: 647 Bytes

Contents

module Inch
  module API
    # Filters a codebase's objects based on given options
    class Filter
      attr_reader :codebase
      attr_reader :objects

      def initialize(codebase, options)
        @codebase = codebase
        codebase.objects.filter! Options::Filter.new(options)
        @objects = codebase.objects.to_a
      end

      def grade_lists(_objects = objects)
        lists = Evaluation.new_grade_lists
        lists.each do |range|
          list = _objects.select { |o| range.scores.include?(o.score) }
          range.objects = Codebase::Objects.sort_by_priority(list)
        end
        lists
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
inch-0.9.0.rc1 lib/inch/api/filter.rb
inch-0.8.0 lib/inch/api/filter.rb
inch-0.8.0.rc2 lib/inch/api/filter.rb
inch-0.8.0.rc1 lib/inch/api/filter.rb
inch-0.7.1 lib/inch/api/filter.rb
inch-0.7.0 lib/inch/api/filter.rb
inch-0.6.4 lib/inch/api/filter.rb
inch-0.6.3 lib/inch/api/filter.rb
inch-0.6.2 lib/inch/api/filter.rb
inch-0.6.1 lib/inch/api/filter.rb