Class: LogStruct::MultiErrorReporter::CallableReporterWrapper
- Inherits:
-
Object
- Object
- LogStruct::MultiErrorReporter::CallableReporterWrapper
- Extended by:
- T::Sig
- Defined in:
- lib/log_struct/multi_error_reporter.rb
Overview
Class variable to store the selected reporter
Instance Attribute Summary collapse
- #callable ⇒ T.untyped (also: #original) readonly
Instance Method Summary collapse
Constructor Details
#initialize(callable) ⇒ void
27 28 29 |
# File 'lib/log_struct/multi_error_reporter.rb', line 27 def initialize(callable) @callable = callable end |
Instance Attribute Details
#callable ⇒ T.untyped (readonly) Also known as: original
32 33 34 |
# File 'lib/log_struct/multi_error_reporter.rb', line 32 def callable @callable end |
Instance Method Details
#call(error, context, source) ⇒ void
This method returns an undefined value.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/log_struct/multi_error_reporter.rb', line 36 def call(error, context, source) case callable_arity when 3 callable.call(error, context, source) when 2 callable.call(error, context) when 1 callable.call(error) else callable.call(error, context, source) end end |