Class: Holoserve::Response::Combiner

Inherits:
Object
  • Object
show all
Defined in:
lib/holoserve/response/combiner.rb

Instance Method Summary collapse

Constructor Details

#initialize(default, responses) ⇒ Combiner

Returns a new instance of Combiner.



4
5
6
# File 'lib/holoserve/response/combiner.rb', line 4

def initialize(default, responses)
  @default, @responses = default, responses
end

Instance Method Details

#responseObject



8
9
10
11
12
# File 'lib/holoserve/response/combiner.rb', line 8

def response
  @responses.inject @default do |result, response|
    Holoserve::Tool::Merger.new(result, response).result
  end
end