Sha256: a7c3e007d687ad7a469fdb6a00ede04a99458a192e236f63f1d3e10bdd9bc1c9

Contents?: true

Size: 644 Bytes

Versions: 6

Compression:

Stored size: 644 Bytes

Contents

require 'alephant/broker/response'

module Alephant
  module Broker
    module Response
      class Factory
        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

        def self.error
          ServerError.new
        end

        def self.not_found
          NotFound.new
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alephant-broker-3.13.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.12.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.11.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.10.2 lib/alephant/broker/response/factory.rb
alephant-broker-3.10.1 lib/alephant/broker/response/factory.rb
alephant-broker-3.10.0 lib/alephant/broker/response/factory.rb