class Taskworld::Client

Attributes

access_token[RW]
default_space_id[RW]
endpoint[RW]
workspaces[RW]

Public Class Methods

config() click to toggle source
# File lib/taskworld/client.rb, line 14
def config
  Config
end
configure() { |Config| ... } click to toggle source
# File lib/taskworld/client.rb, line 10
def configure
  block_given? ? yield(Config) : Config
end
new() click to toggle source
# File lib/taskworld/client.rb, line 19
def initialize
  @endpoint ||= Config::ENDPOINTS.fetch(Config.server, Config::DEFAULT_ENDPONT)
  auth
end

Private Instance Methods

auth() click to toggle source
# File lib/taskworld/client.rb, line 26
def auth
  response = post('auth', email: Config.email, password: Config.password)
  raise 'fail auth' unless response['ok']
  @access_token = response['access_token']
  @default_space_id = response['default_space_id']
  @workspaces = response['workspaces']
end