Sha256: 433b5bae2ce43424126e0c166fcd6369469c86f17ab51caee20558f1bdcf2f92

Contents?: true

Size: 561 Bytes

Versions: 3

Compression:

Stored size: 561 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Common
    module Plugins
      module EnsuresNegatedJSendResult
        class Middleware < MethodChainMiddleware
          intended_for :negated_result, entity: any_entity

          ##
          # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
          #
          def next(...)
            result = chain.next(...)

            result.negated? ? result : result.copy(overrides: {kwargs: {negated: true}})
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/common/plugins/ensures_negated_j_send_result/middleware.rb
convenient_service-0.19.0 lib/convenient_service/common/plugins/ensures_negated_j_send_result/middleware.rb
convenient_service-0.18.0 lib/convenient_service/common/plugins/ensures_negated_j_send_result/middleware.rb