Class: Micro::Service::Pipeline::SafeReducer
- Inherits:
-
Reducer
- Object
- Reducer
- Micro::Service::Pipeline::SafeReducer
show all
- Defined in:
- lib/micro/service/pipeline/reducer.rb
Instance Attribute Summary
Attributes inherited from Reducer
#services
Instance Method Summary
collapse
Methods inherited from Reducer
build, #initialize, map_services, #to_proc
Instance Method Details
#& ⇒ Object
69
|
# File 'lib/micro/service/pipeline/reducer.rb', line 69
alias_method :&, :>>
|
#>>(arg) ⇒ Object
71
72
73
|
# File 'lib/micro/service/pipeline/reducer.rb', line 71
def >>(arg)
raise NoMethodError, "undefined method `>>' for #{self.inspect}. Please, use the method `&' to avoid this error."
end
|
#call(arg = {}) ⇒ Object
62
63
64
65
66
67
|
# File 'lib/micro/service/pipeline/reducer.rb', line 62
def call(arg = {})
@services.reduce(initial_result(arg)) do |result, service|
break result if result.failure?
service_result(service, result)
end
end
|