Class: HttpResource::Auth::Header
- Inherits:
-
Object
- Object
- HttpResource::Auth::Header
- Defined in:
- lib/http_resource/auth/header.rb
Overview
Arbitrary-header auth: sets a custom header (e.g. ‘X-Api-Key: <value>`).
Instance Method Summary collapse
- #apply(request) ⇒ Object
-
#initialize(name, value) ⇒ Header
constructor
A new instance of Header.
Constructor Details
#initialize(name, value) ⇒ Header
Returns a new instance of Header.
7 8 9 10 |
# File 'lib/http_resource/auth/header.rb', line 7 def initialize(name, value) @name = name.to_s @value = value.to_s end |
Instance Method Details
#apply(request) ⇒ Object
12 13 14 |
# File 'lib/http_resource/auth/header.rb', line 12 def apply(request) request[@name] = @value end |