Class: HttpResource::Auth::Header

Inherits:
Object
  • Object
show all
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

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