Sha256: c1535eebce3aeee8da6f2b57562d8942d31b9888709981cbfecb1dc263344174
Contents?: true
Size: 626 Bytes
Versions: 36
Compression:
Stored size: 626 Bytes
Contents
# frozen_string_literal: true module LedgerSync module Util class Performer attr_reader :operations def initialize(operations:) @operations = operations end def perform @perform ||= validate_all .and_then { perform_all } .and_then { Result.Success(self) } end private def perform_all operations.inject(Result.Success) { |res, op| res.and_then { op.perform } } end def validate_all operations.inject(Result.Success) { |res, op| res.and_then { op.validate } } end end end end
Version data entries
36 entries across 36 versions & 1 rubygems