Class: Leap::Decision
- Inherits:
-
Object
- Object
- Leap::Decision
- Includes:
- Blockenspiel::DSL
- Defined in:
- lib/leap/decision.rb
Instance Attribute Summary collapse
-
#committees ⇒ Object
readonly
Returns the value of attribute committees.
-
#goal ⇒ Object
readonly
Returns the value of attribute goal.
-
#minutes ⇒ Object
readonly
Returns the value of attribute minutes.
-
#signature_method ⇒ Object
readonly
Returns the value of attribute signature_method.
Instance Method Summary collapse
- #committee(name, &blk) ⇒ Object
-
#initialize(goal, options) ⇒ Decision
constructor
A new instance of Decision.
- #make(characteristics, *considerations) ⇒ Object
Constructor Details
#initialize(goal, options) ⇒ Decision
Returns a new instance of Decision.
5 6 7 8 9 |
# File 'lib/leap/decision.rb', line 5 def initialize(goal, ) @goal = goal @signature_method = [:with] || {} @committees = [] end |
Instance Attribute Details
#committees ⇒ Object (readonly)
Returns the value of attribute committees.
3 4 5 |
# File 'lib/leap/decision.rb', line 3 def committees @committees end |
#goal ⇒ Object (readonly)
Returns the value of attribute goal.
3 4 5 |
# File 'lib/leap/decision.rb', line 3 def goal @goal end |
#minutes ⇒ Object (readonly)
Returns the value of attribute minutes.
3 4 5 |
# File 'lib/leap/decision.rb', line 3 def minutes @minutes end |
#signature_method ⇒ Object (readonly)
Returns the value of attribute signature_method.
3 4 5 |
# File 'lib/leap/decision.rb', line 3 def signature_method @signature_method end |
Instance Method Details
#committee(name, &blk) ⇒ Object
22 23 24 25 26 |
# File 'lib/leap/decision.rb', line 22 def committee(name, &blk) committee = ::Leap::Committee.new(name) @committees << committee ::Blockenspiel.invoke blk, committee end |
#make(characteristics, *considerations) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/leap/decision.rb', line 11 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 |