Sha256: 966ea04ff6edf4961299a220b9a48a29516688083eb4caf600f9f7d41b3f0121
Contents?: true
Size: 1.22 KB
Versions: 15
Compression:
Stored size: 1.22 KB
Contents
module Leap module Trace def trace @deliberations.inject({}) do |delibs, (goal, deliberation)| delibs[goal] = deliberation.reports.inject([]) do |reports, report| item = { :committee => report.committee.name, :quorum => report.quorum.name, :result => deliberation[report.committee.name].to_s, } item[:params] = report.quorum.characteristics.inject({}) do |hsh, name| hsh[name] = deliberation[name].to_s hsh end item[:compliance] = report.quorum.compliance reports << item end delibs end end def trace_report trace.each do |goal, steps| puts goal if steps steps.each do |step| puts " #{step[:committee]} #{step[:quorum]}" unless step[:params].empty? puts " Params: " step[:params].inspect.split("\n").each { |p| puts " #{p}" } end puts " Complies: " puts " #{step[:compliance]}" puts " Result: #{step[:result].inspect}\n" end else puts " Not computed" end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems