class Checkoff::Clients

Pulls a configured Asana client object which can be used to access the API

Constants

DAY
HOUR
LONG_CACHE_TIME
MINUTE
REALLY_LONG_CACHE_TIME
SHORT_CACHE_TIME

Attributes

workspaces[R]

Public Class Methods

new(config: Checkoff::ConfigLoader.load(:asana), asana_client_class: Asana::Client) click to toggle source
# File lib/checkoff/clients.rb, line 21
def initialize(config: Checkoff::ConfigLoader.load(:asana),
               asana_client_class: Asana::Client)
  @config = config
  @asana_client_class = asana_client_class
end

Private Class Methods

run() click to toggle source
# File lib/checkoff/clients.rb, line 42
def run
  clients = Checkoff::Clients.new
  client = clients.client
  puts "Results: #{client}"
end

Public Instance Methods

client() click to toggle source
# File lib/checkoff/clients.rb, line 27
def client
  @client ||= @asana_client_class.new do |c|
    c.authentication :access_token, @config.fetch(:personal_access_token)
    c.default_headers 'asana-enable' => 'string_ids,new_sections'
    c.default_headers 'asana-disable' => 'new_user_task_lists'
  end
end