Sha256: 3101f4cac5edda28b65ecbd5bb36fe09520e9eddb54d45837803240ef7bebd69

Contents?: true

Size: 453 Bytes

Versions: 6

Compression:

Stored size: 453 Bytes

Contents

module Leap
  class Deliberation
    attr_accessor :characteristics
    attr_accessor :reports
    
    def initialize(characteristics)
      self.characteristics = characteristics
      self.reports = []
    end
    
    def [](characteristic)
      characteristics[characteristic]
    end
    
    def compliance
      reports.map(&:quorum).map(&:compliance).inject do |memo, c|
        next c unless memo
        memo & c
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
leap-0.4.6 lib/leap/deliberation.rb
leap-0.4.5 lib/leap/deliberation.rb
leap-0.4.4 lib/leap/deliberation.rb
leap-0.4.3 lib/leap/deliberation.rb
leap-0.4.2 lib/leap/deliberation.rb
leap-0.4.1 lib/leap/deliberation.rb