Module: ResilientCall::Mixin::ClassMethods
- Defined in:
- lib/resilient_call/mixin.rb
Instance Method Summary collapse
-
#resilient_method(method_name, **options) ⇒ Object
Wraps an already-defined instance method so every invocation runs through ResilientCall.call with the given options (retry, circuit, etc).
Instance Method Details
#resilient_method(method_name, **options) ⇒ Object
Wraps an already-defined instance method so every invocation runs through ResilientCall.call with the given options (retry, circuit, etc).
14 15 16 17 18 19 20 21 22 |
# File 'lib/resilient_call/mixin.rb', line 14 def resilient_method(method_name, **) original = instance_method(method_name) define_method(method_name) do |*args, **kwargs, &block| ResilientCall.call(**) do original.bind_call(self, *args, **kwargs, &block) end end end |