Class: HabiticaClient::Client
- Inherits:
-
Object
- Object
- HabiticaClient::Client
- Includes:
- HTTParty
- Defined in:
- lib/habitica_client/client.rb
Overview
This wraps up httparty functionality in a habitrpg specific class.
Not intented to be accessed directly.
Instance Method Summary collapse
-
#initialize(user_id, api_token) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(user_id, api_token) ⇒ Client
Returns a new instance of Client.
16 17 18 19 20 21 22 23 24 |
# File 'lib/habitica_client/client.rb', line 16 def initialize(user_id, api_token) @user_id = user_id @api_token = api_token self.class.headers('User-Agent' => 'habitapi-rpg', 'Content-Type' => 'application/json', 'x-api-key' => @api_token, 'x-api-user' => @user_id) end |