Sha256: df5fe007d15909be51d6fe16da8d863c0d8ccf851c52d10184df95588e84c7c8

Contents?: true

Size: 542 Bytes

Versions: 6

Compression:

Stored size: 542 Bytes

Contents

require 'alephant/broker/response'

module Alephant
  module Broker
    module Response
      class Factory
        def self.response_for(request)
          case request
          when Request::Asset
            Asset.new(request.component)
          when Request::Batch
            Batch.new(request.components, request.batch_id)
          when Request::Status
            Status.new
          else
            NotFound.new
          end
        end

        def self.error
          ServerError.new
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alephant-broker-1.0.5 lib/alephant/broker/response/factory.rb
alephant-broker-1.0.4 lib/alephant/broker/response/factory.rb
alephant-broker-1.0.3 lib/alephant/broker/response/factory.rb
alephant-broker-1.0.2 lib/alephant/broker/response/factory.rb
alephant-broker-1.0.1 lib/alephant/broker/response/factory.rb
alephant-broker-1.0.0 lib/alephant/broker/response/factory.rb