Class: ConvenientService::Service::Plugins::HasJSendResultShortSyntax::Success::Middleware

Inherits:
MethodChainMiddleware
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/middleware.rb

Instance Method Summary collapse

Instance Method Details

#next(*args, **kwargs, &block) ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result

Parameters:

  • args (Array<Object>)
  • kwargs (Hash{Symbol => Object})
  • block (Proc, nil)

Returns:



17
18
19
20
21
# File 'lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/middleware.rb', line 17

def next(*args, **kwargs, &block)
  Commands::RefuteKwargsContainJSendAndExtraKeys[kwargs: kwargs]

  ([:data, :message, :code].any? { |key| kwargs.has_key?(key) }) ? chain.next(**kwargs) : chain.next(data: kwargs)
end