class Todoist::Client

Public Class Methods

create_client_by_login(email, password) click to toggle source

TODO: Need to write a unit test for this

# 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) click to toggle source
# File lib/todoist/client.rb, line 4
def self.create_client_by_token(token)
  client = Client.new
  client.token = token
  client
end
new() click to toggle source
# File lib/todoist/client.rb, line 112
def initialize
  @api_helper = Todoist::Util::ApiHelper.new(self)
end

Public Instance Methods

api_helper() click to toggle source
# File lib/todoist/client.rb, line 106
def api_helper
  @api_helper
end
misc_activity() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# File lib/todoist/client.rb, line 71
def misc_uploads
  @misc_uploads = Todoist::Misc::Uploads.new(self) unless @misc_uploads
  @misc_uploads
end
sync() click to toggle source
# File lib/todoist/client.rb, line 27
def sync
  @api_helper.sync
end
sync_filters() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# File lib/todoist/client.rb, line 101
def sync_reminders
  @sync_reminders = Todoist::Sync::Reminders.new(self) unless @sync_reminders
  @sync_reminders
end
token() click to toggle source
# File lib/todoist/client.rb, line 23
def token
  @token
end
token=(token) click to toggle source
# File lib/todoist/client.rb, line 19
def token=(token)
  @token = token.chomp
end