lib/micro/service/pipeline.rb in u-service-0.12.0 vs lib/micro/service/pipeline.rb in u-service-0.13.0

- old
+ new

@@ -26,11 +26,11 @@ def initialize(services) @services = services end - def call(arg={}) + def call(arg = {}) @services.reduce(initial_result(arg)) do |result, service| break result if result.failure? service.__new__(result, result.value).call end end @@ -43,11 +43,11 @@ def initial_result(arg) return arg.call if arg_to_call?(arg) return arg if arg.is_a?(Micro::Service::Result) result = Micro::Service::Result.new - result.__set__(true, arg, nil) + result.__set__(true, arg, :ok) end def arg_to_call?(arg) return true if arg.is_a?(Micro::Service::Base) || arg.is_a?(Reducer) return true if arg.is_a?(Class) && (arg < Micro::Service::Base || arg < Micro::Service::Pipeline) @@ -62,10 +62,10 @@ def pipeline(*args) @__pipeline = Reducer.build(args) end - def call(options={}) + def call(options = {}) new(options).call end end private_constant :ClassMethods