lib/alephant/broker/models/response_factory.rb in alephant-broker-0.0.2 vs lib/alephant/broker/models/response_factory.rb in alephant-broker-0.0.3
- old
+ new
@@ -3,26 +3,24 @@
module Alephant
module Broker
class ResponseFactory
- def initialize(config)
+ def initialize(config = nil)
@config = config
end
def response_from(request)
-
case request.type
when :asset
AssetResponse.new(request, @config)
when :status
response(200)
when :notfound
response(404)
when :error
response(500)
end
-
end
def response(status)
Response.new(status)
end