Class: Leap::Committee

Inherits:
Object
  • Object
show all
Includes:
Blockenspiel::DSL
Defined in:
lib/leap/committee.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/leap/committee.rb', line 3

def name
  @name
end

#quorumsObject (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, options = {}, &blk)
  @quorums << ::Leap::Quorum.new(name, options, 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