Class: Mastodon::Headers
- Inherits:
-
Object
- Object
- Mastodon::Headers
- Defined in:
- lib/mastodon/headers.rb
Overview
Class to handle headers. Important for OAuth2 to work properly.
Instance Method Summary collapse
-
#initialize(client) ⇒ Headers
constructor
A new instance of Headers.
- #request_headers ⇒ Hash
Constructor Details
#initialize(client) ⇒ Headers
Returns a new instance of Headers.
7 8 9 |
# File 'lib/mastodon/headers.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#request_headers ⇒ Hash
12 13 14 15 16 17 18 |
# File 'lib/mastodon/headers.rb', line 12 def request_headers { user_agent: @client.user_agent, accept: '*/*', authorization: "Bearer #{@client.bearer_token}" } end |