Sha256: 854f90df11abd41a8f1c0f05b3d79683f6670cd618465ccf0b6aad97bf916920

Contents?: true

Size: 596 Bytes

Versions: 2

Compression:

Stored size: 596 Bytes

Contents

module AnalDiffist
  class DiffSet
    def initialize before, after
      @before = before
      @after = after
    end

    def added_problems
      compare(@after, @before)
    end

    def removed_problems
      compare(@before, @after)
    end

    private
    def compare(a,b)
      #TODO: move this comparison into the class?
      a.map do |problem| 
        matching_problem = b.detect {|problem2| [problem.type, problem.context] == [problem2.type, problem2.context] }

          problem.diff(matching_problem)

      end.reject {|x| x.nil?}
    end
  end

  class ScoreDiffSet
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
analdiffist-0.3.0 lib/analdiffist/diff_set.rb
analdiffist-0.2.0 lib/analdiffist/diff_set.rb