Class: HabiticaClient::Client

Inherits:
Object
  • Object
show all
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

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