Class: LedgerSync::Util::Performer

Inherits:
Object
  • Object
show all
Defined in:
lib/ledger_sync/util/performer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operations:) ⇒ Performer

Returns a new instance of Performer.



8
9
10
# File 'lib/ledger_sync/util/performer.rb', line 8

def initialize(operations:)
  @operations = operations
end

Instance Attribute Details

#operationsObject (readonly)

Returns the value of attribute operations.



6
7
8
# File 'lib/ledger_sync/util/performer.rb', line 6

def operations
  @operations
end

Instance Method Details

#performObject



12
13
14
15
16
# File 'lib/ledger_sync/util/performer.rb', line 12

def perform
  @perform ||= validate_all
               .and_then { perform_all }
               .and_then { Result.Success(self) }
end