Class: AuthBearer
Instance Attribute Summary collapse
-
#val ⇒ Object
Returns the value of attribute val.
Instance Method Summary collapse
- #add_auth(http_client, req_kwargs) ⇒ Object
-
#initialize(val: nil) ⇒ AuthBearer
constructor
A new instance of AuthBearer.
Constructor Details
#initialize(val: nil) ⇒ AuthBearer
Returns a new instance of AuthBearer.
54 55 56 |
# File 'lib/one_doc.rb', line 54 def initialize(val: nil) @val = val end |
Instance Attribute Details
#val ⇒ Object
Returns the value of attribute val.
52 53 54 |
# File 'lib/one_doc.rb', line 52 def val @val end |
Instance Method Details
#add_auth(http_client, req_kwargs) ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'lib/one_doc.rb', line 58 def add_auth(http_client, req_kwargs) if !@val.nil? headers = req_kwargs.fetch(:headers, {}) headers["Authorization"] = "Bearer " + @val req_kwargs[:headers] = headers end return http_client, req_kwargs end |