Class: Alephant::Broker::Response::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/alephant/broker/response/factory.rb

Class Method Summary collapse

Class Method Details

.errorObject



20
21
22
# File 'lib/alephant/broker/response/factory.rb', line 20

def self.error
  ServerError.new
end

.not_foundObject



24
25
26
# File 'lib/alephant/broker/response/factory.rb', line 24

def self.not_found
  NotFound.new
end

.response_for(request, request_env) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/alephant/broker/response/factory.rb', line 7

def self.response_for(request, request_env)
  case request
  when Request::Asset
    Asset.new(request.component, request_env)
  when Request::Batch
    Batch.new(request.components, request.batch_id, request_env)
  when Request::Status
    Status.new
  else
    NotFound.new
  end
end