Class: David::ETSI::Optional::Rack

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

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



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

def call(env)
  return case request(env)
  when 'GET /large'
    [2.05, {'Content-Type' => 'text/plain'}, ['*'*1025]]
  when 'GET /obs'
    [2.05,
      {
        'Content-Type' => 'text/plain',
        'ETag' => rand(0xffff).to_s
      },
      [Time.now.to_s]
    ]
  else
    [404, {}, []]
  end
end