Sha256: d3da68e30b13b9aae01f3d6040a299c7eb81253b81269871f3e8556fb8c8a05d

Contents?: true

Size: 959 Bytes

Versions: 8

Compression:

Stored size: 959 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module HasJSendResult
        module Entities
          class Result
            module Plugins
              module HasJSendStatusAndAttributes
                class Middleware < MethodChainMiddleware
                  intended_for :initialize, entity: :result

                  ##
                  # @param args [Array<Object>]
                  # @param kwargs [Hash{Symbol => Object}]
                  # @param block [Proc, nil]
                  # @return [void]
                  #
                  def next(*args, **kwargs, &block)
                    entity.internals.cache[:jsend_attributes] = Commands::CastJSendAttributes.call(result: entity, kwargs: kwargs)

                    chain.next(*args, **kwargs, &block)
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/middleware.rb
convenient_service-0.19.0 lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/middleware.rb
convenient_service-0.18.0 lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/middleware.rb
convenient_service-0.17.0 lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/middleware.rb
convenient_service-0.16.0 lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/middleware.rb
convenient_service-0.15.0 lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/middleware.rb
convenient_service-0.14.0 lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/middleware.rb
convenient_service-0.13.0 lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/middleware.rb