Sha256: f674387f3cf507bac8111b52dc0054f2ec53f39ad4fcf59c5cfc0eddab66f2bc

Contents?: true

Size: 643 Bytes

Versions: 11

Compression:

Stored size: 643 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

11 entries across 11 versions & 1 rubygems

Version Path
alephant-broker-3.19.1 lib/alephant/broker/response/factory.rb
alephant-broker-3.19.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.18.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.17.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.16.2 lib/alephant/broker/response/factory.rb
alephant-broker-3.16.1 lib/alephant/broker/response/factory.rb
alephant-broker-3.16.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.15.2 lib/alephant/broker/response/factory.rb
alephant-broker-3.15.1 lib/alephant/broker/response/factory.rb
alephant-broker-3.15.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.14.0 lib/alephant/broker/response/factory.rb