Class: Rack::Delegate::NetworkErrorResponse

Inherits:
Struct
  • Object
show all
Defined in:
lib/rack/delegate/network_error_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#envObject

Returns the value of attribute env

Returns:

  • (Object)

    the current value of env



3
4
5
# File 'lib/rack/delegate/network_error_response.rb', line 3

def env
  @env
end

Class Method Details

.call(env) ⇒ Object



4
5
6
# File 'lib/rack/delegate/network_error_response.rb', line 4

def self.call(env)
  new(env).call
end

Instance Method Details

#callObject



8
9
10
11
12
13
14
# File 'lib/rack/delegate/network_error_response.rb', line 8

def call
  status = 504
  headers = {'Content-Type' => 'text/plain'}
  body = ["Gateway Timeout\n"]

  [status, headers, body]
end