Sha256: f67d686a0c03d45fc65d02c7c3ba83218732c756d3aa40cbf289b1eb9b06c535

Contents?: true

Size: 837 Bytes

Versions: 2

Compression:

Stored size: 837 Bytes

Contents

module Leap
  class Decision
    attr_reader :goal, :signature_method, :committees, :minutes
    
    def initialize(goal, options)
      @goal = goal
      @signature_method = options[:with] || {}
      @committees = []
    end
    
    def make(characteristics, *considerations)
      committees.reverse.inject(Deliberation.new(characteristics)) do |deliberation, committee|
        if report = committee.report(deliberation.characteristics, considerations)
          deliberation.reports.unshift report
          deliberation.characteristics[committee.name] = report.conclusion
        end
        deliberation
      end
    end
    
    include ::Blockenspiel::DSL
    def committee(name, &blk)
      committee = ::Leap::Committee.new(name)
      @committees << committee
      ::Blockenspiel.invoke blk, committee
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
leap-0.3.2 lib/leap/decision.rb
leap-0.3.1 lib/leap/decision.rb