Sha256: b3bfdeccc6d74a34c23350b0a4d26c0861509add2b56cf0777c74d4a34b6b01c

Contents?: true

Size: 416 Bytes

Versions: 6

Compression:

Stored size: 416 Bytes

Contents

require 'alephant/broker/request'

module Alephant::Broker::Request
  class Factory

    def self.request_type_from(env)
      env.path.split('/')[1]
    end

    def self.request_for(env)
      case request_type_from(env)
      when 'component'
        Asset.new(env)
      when 'components'
        Batch.new(env)
      when 'status'
        Status.new
      else
        NotFound.new
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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