Sha256: 42357122e1e3fe61d76fd72f3e94e47b9f002defbedacfa178e5480adfb7d087

Contents?: true

Size: 605 Bytes

Versions: 24

Compression:

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

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
alephant-broker-3.9.2 lib/alephant/broker/response/factory.rb
alephant-broker-3.9.1 lib/alephant/broker/response/factory.rb
alephant-broker-3.9.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.8.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.7.1 lib/alephant/broker/response/factory.rb
alephant-broker-3.7.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.6.1 lib/alephant/broker/response/factory.rb
alephant-broker-3.6.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.5.5 lib/alephant/broker/response/factory.rb
alephant-broker-3.5.4 lib/alephant/broker/response/factory.rb
alephant-broker-3.5.3 lib/alephant/broker/response/factory.rb
alephant-broker-3.5.2 lib/alephant/broker/response/factory.rb
alephant-broker-3.5.1 lib/alephant/broker/response/factory.rb
alephant-broker-3.5.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.4.1 lib/alephant/broker/response/factory.rb
alephant-broker-3.4.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.3.2 lib/alephant/broker/response/factory.rb
alephant-broker-3.3.1 lib/alephant/broker/response/factory.rb
alephant-broker-3.3.0 lib/alephant/broker/response/factory.rb
alephant-broker-3.2.0 lib/alephant/broker/response/factory.rb