Class: ConvenientService::Common::Plugins::CanHaveCallbacks::Middleware

Inherits:
MethodChainMiddleware
  • Object
show all
Defined in:
lib/convenient_service/common/plugins/can_have_callbacks/middleware.rb

Instance Method Summary collapse

Instance Method Details

#any_methodObject



12
# File 'lib/convenient_service/common/plugins/can_have_callbacks/middleware.rb', line 12

intended_for any_method, entity: any_entity

#next(*args, **kwargs, &block) ⇒ Object

Returns Can be any type.

Parameters:

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

Returns:

  • (Object)

    Can be any type.



23
24
25
26
27
28
29
30
31
# File 'lib/convenient_service/common/plugins/can_have_callbacks/middleware.rb', line 23

def next(*args, **kwargs, &block)
  run_before_callbacks(*args, **kwargs, &block)

  original_value = run_around_callbacks(*args, **kwargs, &block)

  run_after_callbacks(original_value, *args, **kwargs, &block)

  original_value
end