Class: Alephant::Broker::Request::Factory
- Inherits:
-
Object
- Object
- Alephant::Broker::Request::Factory
- Defined in:
- lib/alephant/broker/request/factory.rb
Class Method Summary collapse
Class Method Details
.request_for(env) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/alephant/broker/request/factory.rb', line 10 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 |
.request_type_from(env) ⇒ Object
6 7 8 |
# File 'lib/alephant/broker/request/factory.rb', line 6 def self.request_type_from(env) env.path.split('/')[1] end |