Class: HabiticaClient

Inherits:
Object
  • Object
show all
Defined in:
lib/habitica_client.rb,
lib/habitica_client/task.rb,
lib/habitica_client/user.rb,
lib/habitica_client/tasks.rb,
lib/habitica_client/client.rb,
lib/habitica_client/restful.rb,
lib/habitica_client/version.rb,
lib/habitica_client/api_base.rb

Defined Under Namespace

Classes: ApiBase, Client, Restful, Task, Tasks, User

Constant Summary collapse

VERSION =
'1.0.1'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_id, api_token) ⇒ HabiticaClient


10
11
12
# File 'lib/habitica_client.rb', line 10

def initialize(user_id, api_token)
  self.client = Client.new(user_id, api_token)
end

Instance Attribute Details

#clientObject

Returns the value of attribute client


8
9
10
# File 'lib/habitica_client.rb', line 8

def client
  @client
end

Instance Method Details

#tasksObject


18
19
20
# File 'lib/habitica_client.rb', line 18

def tasks
  @tasks ||= Tasks.new(client)
end

#userObject


14
15
16
# File 'lib/habitica_client.rb', line 14

def user
  @user ||= User.new(client)
end