Class: David::ETSI::Mandatory::Rack

Inherits:
Object
  • Object
show all
Defined in:
lib/david/etsi/mandatory/rack.rb

Constant Summary collapse

EMPTY_CONTENT =
[2.05, {'Content-Type' => 'text/plain'}, ['foo']]

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/david/etsi/mandatory/rack.rb', line 5

def call(env)
  return case request(env)
  when 'GET /test', 'GET /seg1/seg2/seg3', 'GET /query'
    EMPTY_CONTENT
  when 'POST /test'
    [2.01, {}, []]
  when 'PUT /test'
    [2.04, {}, []]
  when 'DELETE /test'
    [2.02, {}, []]
  else
    [404, {}, []]
  end
end