Class: Nonnative::Header
- Inherits:
-
Object
- Object
- Nonnative::Header
- Defined in:
- lib/nonnative/header.rb
Class Method Summary collapse
- .auth_basic(credentials) ⇒ Object
- .auth_bearer(token) ⇒ Object
- .grpc_user_agent(user_agent) ⇒ Object
- .http_user_agent(user_agent) ⇒ Object
Class Method Details
.auth_basic(credentials) ⇒ Object
14 15 16 |
# File 'lib/nonnative/header.rb', line 14 def auth_basic(credentials) { authorization: "Basic #{Base64.strict_encode64(credentials)}" } end |
.auth_bearer(token) ⇒ Object
18 19 20 |
# File 'lib/nonnative/header.rb', line 18 def auth_bearer(token) { authorization: "Bearer #{token}" } end |
.grpc_user_agent(user_agent) ⇒ Object
10 11 12 |
# File 'lib/nonnative/header.rb', line 10 def grpc_user_agent(user_agent) { 'grpc.primary_user_agent' => user_agent } end |
.http_user_agent(user_agent) ⇒ Object
6 7 8 |
# File 'lib/nonnative/header.rb', line 6 def http_user_agent(user_agent) { user_agent: } end |