Class: Specter::Middleware::Missing

Inherits:
Base
  • Object
show all
Defined in:
lib/specter/middleware/missing.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Specter::Middleware::Base

Instance Method Details

#call(env) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/specter/middleware/missing.rb', line 5

def call(env)
  @app.call(env)

  if env.empty?
    env.merge!(
      'STATUS' => [
        {
          'STATUS' => 'E',
          'When' => Time.now.to_i,
          'Code' => 14,
          'Msg' => 'Invalid command',
          'Description' => "specter #{VERSION}"
        }
      ],
      'id' => 1
    )
  end
end