Class: Todoist::Client
- Inherits:
-
Object
- Object
- Todoist::Client
- Defined in:
- lib/todoist/client.rb
Class Method Summary collapse
-
.create_client_by_login(email, password) ⇒ Object
TODO: Need to write a unit test for this.
- .create_client_by_token(token) ⇒ Object
Instance Method Summary collapse
- #api_helper ⇒ Object
- #misc_activity ⇒ Object
- #misc_backups ⇒ Object
- #misc_completed ⇒ Object
- #misc_items ⇒ Object
- #misc_projects ⇒ Object
- #misc_query ⇒ Object
- #misc_quick ⇒ Object
- #misc_templates ⇒ Object
- #misc_uploads ⇒ Object
- #sync ⇒ Object
- #sync_filters ⇒ Object
- #sync_items ⇒ Object
- #sync_labels ⇒ Object
- #sync_notes ⇒ Object
- #sync_projects ⇒ Object
- #sync_reminders ⇒ Object
- #token ⇒ Object
- #token=(token) ⇒ Object
Class Method Details
.create_client_by_login(email, password) ⇒ Object
TODO: Need to write a unit test for this
11 12 13 14 15 16 17 |
# File 'lib/todoist/client.rb', line 11 def self.create_client_by_login(email, password) client = Client.new result = client.api_helper.get_response(Config::TODOIST_USER_LOGIN_COMMAND, {email: email, password: password}, false) user = Todoist::Util::ParseHelper.make_object(result) client.token = user.token client end |
.create_client_by_token(token) ⇒ Object
4 5 6 7 8 |
# File 'lib/todoist/client.rb', line 4 def self.create_client_by_token(token) client = Client.new client.token = token client end |
Instance Method Details
#api_helper ⇒ Object
106 107 108 |
# File 'lib/todoist/client.rb', line 106 def api_helper @api_helper end |
#misc_activity ⇒ Object
31 32 33 34 |
# File 'lib/todoist/client.rb', line 31 def misc_activity @misc_activity = Todoist::Misc::Activity.new(self) unless @misc_activity @misc_activity end |
#misc_backups ⇒ Object
36 37 38 39 |
# File 'lib/todoist/client.rb', line 36 def misc_backups @misc_backups = Todoist::Misc::Backups.new(self) unless @misc_backups @misc_backups end |
#misc_completed ⇒ Object
41 42 43 44 |
# File 'lib/todoist/client.rb', line 41 def misc_completed @misc_completed = Todoist::Misc::Completed.new(self) unless @misc_completed @misc_completed end |
#misc_items ⇒ Object
46 47 48 49 |
# File 'lib/todoist/client.rb', line 46 def misc_items @misc_items = Todoist::Misc::Items.new(self) unless @misc_items @misc_items end |
#misc_projects ⇒ Object
51 52 53 54 |
# File 'lib/todoist/client.rb', line 51 def misc_projects @misc_projects = Todoist::Misc::Projects.new(self) unless @misc_projects @misc_projects end |
#misc_query ⇒ Object
56 57 58 59 |
# File 'lib/todoist/client.rb', line 56 def misc_query @misc_query = Todoist::Misc::Query.new(self) unless @misc_query @misc_query end |
#misc_quick ⇒ Object
61 62 63 64 |
# File 'lib/todoist/client.rb', line 61 def misc_quick @misc_quick = Todoist::Misc::Quick.new(self) unless @misc_quick @misc_quick end |
#misc_templates ⇒ Object
66 67 68 69 |
# File 'lib/todoist/client.rb', line 66 def misc_templates @misc_templates = Todoist::Misc::Templates.new(self) unless @misc_templates @misc_templates end |
#misc_uploads ⇒ Object
71 72 73 74 |
# File 'lib/todoist/client.rb', line 71 def misc_uploads @misc_uploads = Todoist::Misc::Uploads.new(self) unless @misc_uploads @misc_uploads end |
#sync ⇒ Object
27 28 29 |
# File 'lib/todoist/client.rb', line 27 def sync @api_helper.sync end |
#sync_filters ⇒ Object
76 77 78 79 |
# File 'lib/todoist/client.rb', line 76 def sync_filters @sync_filters = Todoist::Sync::Filters.new(self) unless @sync_filters @sync_filters end |
#sync_items ⇒ Object
81 82 83 84 |
# File 'lib/todoist/client.rb', line 81 def sync_items @sync_items = Todoist::Sync::Items.new(self) unless @sync_items @sync_items end |
#sync_labels ⇒ Object
86 87 88 89 |
# File 'lib/todoist/client.rb', line 86 def sync_labels @sync_labels = Todoist::Sync::Labels.new(self) unless @sync_labels @sync_labels end |
#sync_notes ⇒ Object
91 92 93 94 |
# File 'lib/todoist/client.rb', line 91 def sync_notes @sync_notes = Todoist::Sync::Notes.new(self) unless @sync_notes @sync_notes end |
#sync_projects ⇒ Object
96 97 98 99 |
# File 'lib/todoist/client.rb', line 96 def sync_projects @sync_projects = Todoist::Sync::Projects.new(self) unless @sync_projects @sync_projects end |
#sync_reminders ⇒ Object
101 102 103 104 |
# File 'lib/todoist/client.rb', line 101 def sync_reminders @sync_reminders = Todoist::Sync::Reminders.new(self) unless @sync_reminders @sync_reminders end |
#token ⇒ Object
23 24 25 |
# File 'lib/todoist/client.rb', line 23 def token @token end |
#token=(token) ⇒ Object
19 20 21 |
# File 'lib/todoist/client.rb', line 19 def token=(token) @token = token.chomp end |