Class: AuthKeyHeader
Instance Attribute Summary collapse
-
#header_name ⇒ Object
Returns the value of attribute header_name.
-
#val ⇒ Object
Returns the value of attribute val.
Instance Method Summary collapse
- #add_auth(http_client, req_kwargs) ⇒ Object
-
#initialize(header_name: nil, val: nil) ⇒ AuthKeyHeader
constructor
A new instance of AuthKeyHeader.
Constructor Details
#initialize(header_name: nil, val: nil) ⇒ AuthKeyHeader
Returns a new instance of AuthKeyHeader.
95 96 97 98 |
# File 'lib/one_doc.rb', line 95 def initialize(header_name: nil, val: nil) @header_name = header_name @val = val end |
Instance Attribute Details
#header_name ⇒ Object
Returns the value of attribute header_name.
93 94 95 |
# File 'lib/one_doc.rb', line 93 def header_name @header_name end |
#val ⇒ Object
Returns the value of attribute val.
93 94 95 |
# File 'lib/one_doc.rb', line 93 def val @val end |
Instance Method Details
#add_auth(http_client, req_kwargs) ⇒ Object
100 101 102 103 104 105 106 107 108 |
# File 'lib/one_doc.rb', line 100 def add_auth(http_client, req_kwargs) if !@val.nil? headers = req_kwargs.fetch(:headers, {}) headers[@header_name] = @val req_kwargs[:headers] = headers end return http_client, req_kwargs end |