Sha256: fe3ea4827146d370cbd0a279c1d286c09df1c98d82713ccbd5872f44a50eef07

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

module Leap
  class Decision
    attr_reader :goal, :signature_method, :committees, :minutes
    
    def initialize(goal, options)
      @goal = goal
      @signature_method = options[:with] || :_leap_implicit_attributes
      @committees = []
    end
    
    def make(characteristics, *considerations)
      options = considerations.extract_options!
      committees.reject { |c| characteristics.keys.include? c.name }.reverse.inject(Deliberation.new(characteristics)) do |deliberation, committee|
        if report = committee.report(deliberation.characteristics, considerations, options)
          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.4.4 lib/leap/decision.rb
leap-0.4.3 lib/leap/decision.rb