Class: HabiticaClient::Tasks
- Defined in:
- lib/habitica_client/tasks.rb,
lib/habitica_client/tasks/types.rb,
lib/habitica_client/tasks/status.rb
Overview
An enumerable object of all the user's tasks.
Also contains the endpoint for creating new tasks.
Defined Under Namespace
Instance Attribute Summary
Attributes inherited from ApiBase
Instance Method Summary collapse
-
#create(attributes = {}) ⇒ Object
Create a new task (and save it to habitrpg.com).
-
#each ⇒ Object
Iterate over user tasks.
Methods included from Status
Methods included from Types
#by_type, #dailies, #habits, #todos
Methods inherited from ApiBase
#data, #endpoint, endpoint, #initialize
Constructor Details
This class inherits a constructor from HabiticaClient::ApiBase
Instance Method Details
#create(attributes = {}) ⇒ Object
Create a new task (and save it to habitrpg.com)
28 29 30 |
# File 'lib/habitica_client/tasks.rb', line 28 def create(attributes = {}) Task.new(client, attributes).save end |
#each ⇒ Object
Iterate over user tasks
19 20 21 22 23 |
# File 'lib/habitica_client/tasks.rb', line 19 def each data.each do |task| yield Task.parse(client, task) end end |