Class: Brine::Performing::CollectingPerformer
- Inherits:
-
Object
- Object
- Brine::Performing::CollectingPerformer
- Defined in:
- lib/brine/performing.rb
Overview
Collect actions to be evaluated later.
Instance Method Summary collapse
-
#evaluate ⇒ Object
Evaluate the collected actions in sequence.
-
#initialize ⇒ CollectingPerformer
constructor
Construct an instance with an empty collection of actions.
-
#perform(actions) ⇒ Object
Collect provided actions.
Constructor Details
#initialize ⇒ CollectingPerformer
Construct an instance with an empty collection of actions.
38 39 40 |
# File 'lib/brine/performing.rb', line 38 def initialize @actions = [] end |
Instance Method Details
#evaluate ⇒ Object
Evaluate the collected actions in sequence.
54 55 56 |
# File 'lib/brine/performing.rb', line 54 def evaluate @actions.each { |it| it.call } end |
#perform(actions) ⇒ Object
Collect provided actions.
47 48 49 |
# File 'lib/brine/performing.rb', line 47 def perform(actions) @actions << actions end |