Sha256: 8eeac408518a949dc370ad64dcd05a9d2dbe67d5ba22e2c31849194ae2674895

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 Bytes

Contents

require 'alephant/broker/models/request/error_request.rb'
require 'alephant/broker/models/request/get_request.rb'
require 'alephant/broker/models/request/notfound_request.rb'
require 'alephant/broker/models/request/post_request.rb'
require 'alephant/broker/models/request/status_request.rb'

module Alephant
  module Broker
    class RequestFactory
      def self.process(type)
        case type
        when :component
          GetRequest.new
        when :component_batch
          PostRequest.new
        when :status
          StatusRequest.new
        when :notfound
          NotFoundRequest.new
        when :error
          ErrorRequest.new
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alephant-broker-0.1.1 lib/alephant/broker/models/request_factory.rb
alephant-broker-0.1.0 lib/alephant/broker/models/request_factory.rb