Class: Roda::RodaPlugins::RequestHeaders::Headers
- Inherits:
-
Object
- Object
- Roda::RodaPlugins::RequestHeaders::Headers
- Defined in:
- lib/roda/plugins/request_headers.rb
Constant Summary collapse
- CGI_VARIABLES =
Set of environment variable names that don’t need HTTP_ prepended to them.
Set.new(%w' AUTH_TYPE CONTENT_LENGTH CONTENT_TYPE GATEWAY_INTERFACE HTTPS PATH_INFO PATH_TRANSLATED QUERY_STRING REMOTE_ADDR REMOTE_HOST REMOTE_IDENT REMOTE_USER REQUEST_METHOD SCRIPT_NAME SERVER_NAME SERVER_PORT SERVER_PROTOCOL SERVER_SOFTWARE ').freeze
Instance Method Summary collapse
-
#[](key) ⇒ Object
Returns the value for the given key mapped to @env.
-
#initialize(env) ⇒ Headers
constructor
A new instance of Headers.
Constructor Details
#initialize(env) ⇒ Headers
Returns a new instance of Headers.
58 59 60 |
# File 'lib/roda/plugins/request_headers.rb', line 58 def initialize(env) @env = env end |
Instance Method Details
#[](key) ⇒ Object
Returns the value for the given key mapped to @env
63 64 65 |
# File 'lib/roda/plugins/request_headers.rb', line 63 def [](key) @env[env_name(key)] end |