Class: Brine::Performing::CollectingPerformer

Inherits:
Object
  • Object
show all
Defined in:
lib/brine/performing.rb

Overview

Collect actions to be evaluated later.

Instance Method Summary collapse

Constructor Details

#initializeCollectingPerformer

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

#evaluateObject

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.

Parameters:

  • actions (Proc)

    Provide actions to collect.



47
48
49
# File 'lib/brine/performing.rb', line 47

def perform(actions)
  @actions << actions
end