Class: Leap::Deliberation
- Inherits:
-
Object
- Object
- Leap::Deliberation
- Defined in:
- lib/leap/deliberation.rb
Overview
Encapsulates a single computation of a Leap subject’s decision, as performed on an instance of that subject class.
Instance Attribute Summary collapse
-
#characteristics ⇒ Object
Accumulates knowledge about the Leap subject instance, beginning with the instance’s explicit attributes, and later augmented by committee proceedings.
-
#reports ⇒ Object
Accumulates proceedings of the deliberation, including conclusions and methodology.
Instance Method Summary collapse
-
#[](characteristic) ⇒ Object
Convenience method to access values within the deliberation’s characteristics hash.
-
#compliance(committee = nil) ⇒ Array
Report which named protocols the deliberation incidentally complied with.
-
#initialize(characteristics) ⇒ Deliberation
constructor
Create a new deliberation, to be made in light of the provided characteristics of the Leap subject instance.
-
#report(committee) ⇒ Object
Convenience method to access a certain committee’s report within this deliberation.
Constructor Details
#initialize(characteristics) ⇒ Deliberation
Create a new deliberation, to be made in light of the provided characteristics of the Leap subject instance.
12 13 14 15 |
# File 'lib/leap/deliberation.rb', line 12 def initialize(characteristics) self.characteristics = characteristics self.reports = [] end |
Instance Attribute Details
#characteristics ⇒ Object
Accumulates knowledge about the Leap subject instance, beginning with the instance’s explicit attributes, and later augmented by committee proceedings.
5 6 7 |
# File 'lib/leap/deliberation.rb', line 5 def characteristics @characteristics end |
#reports ⇒ Object
Accumulates proceedings of the deliberation, including conclusions and methodology.
8 9 10 |
# File 'lib/leap/deliberation.rb', line 8 def reports @reports end |
Instance Method Details
#[](characteristic) ⇒ Object
Convenience method to access values within the deliberation’s characteristics hash.
19 20 21 |
# File 'lib/leap/deliberation.rb', line 19 def [](characteristic) characteristics[characteristic] end |
#compliance(committee = nil) ⇒ Array
Report which named protocols the deliberation incidentally complied with.
32 33 34 |
# File 'lib/leap/deliberation.rb', line 32 def compliance(committee = nil) (committee ? compliance_from(committee) : general_compliance) || [] end |
#report(committee) ⇒ Object
Convenience method to access a certain committee’s report within this deliberation.
25 26 27 |
# File 'lib/leap/deliberation.rb', line 25 def report(committee) reports.find { |r| r.committee.name == committee } end |