Class: Leap::Committee
- Inherits:
-
Object
- Object
- Leap::Committee
- Includes:
- Blockenspiel::DSL
- Defined in:
- lib/leap/committee.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#quorums ⇒ Object
readonly
Returns the value of attribute quorums.
Instance Method Summary collapse
- #default(&blk) ⇒ Object
-
#initialize(name) ⇒ Committee
constructor
A new instance of Committee.
- #quorum(name, options = {}, &blk) ⇒ Object
- #report(characteristics, considerations) ⇒ Object
Constructor Details
#initialize(name) ⇒ Committee
Returns a new instance of Committee.
5 6 7 8 |
# File 'lib/leap/committee.rb', line 5 def initialize(name) @name = name @quorums = [] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/leap/committee.rb', line 3 def name @name end |
#quorums ⇒ Object (readonly)
Returns the value of attribute quorums.
3 4 5 |
# File 'lib/leap/committee.rb', line 3 def quorums @quorums end |
Instance Method Details
#default(&blk) ⇒ Object
24 25 26 |
# File 'lib/leap/committee.rb', line 24 def default(&blk) quorum 'default', {}, &blk end |
#quorum(name, options = {}, &blk) ⇒ Object
20 21 22 |
# File 'lib/leap/committee.rb', line 20 def quorum(name, = {}, &blk) @quorums << ::Leap::Quorum.new(name, , blk) end |
#report(characteristics, considerations) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/leap/committee.rb', line 10 def report(characteristics, considerations) quorums.grab do |quorum| next unless quorum.satisfied_by? characteristics if conclusion = quorum.acknowledge(characteristics.slice(*quorum.characteristics), considerations.dup) ::Leap::Report.new self, quorum => conclusion end end end |