Class: Checkoff::Clients
- Inherits:
-
Object
- Object
- Checkoff::Clients
- Defined in:
- lib/checkoff/clients.rb
Overview
Pulls a configured Asana client object which can be used to access the API
Constant Summary collapse
- MINUTE =
60
- HOUR =
MINUTE * 60
- DAY =
24 * HOUR
- REALLY_LONG_CACHE_TIME =
HOUR * 1
- LONG_CACHE_TIME =
MINUTE * 15
- SHORT_CACHE_TIME =
MINUTE
Class Method Summary collapse
Instance Method Summary collapse
- #client ⇒ Asana::Client
-
#initialize(config: Checkoff::Internal::ConfigLoader.load(:asana), asana_client_class: Asana::Client) ⇒ Clients
constructor
A new instance of Clients.
Constructor Details
#initialize(config: Checkoff::Internal::ConfigLoader.load(:asana), asana_client_class: Asana::Client) ⇒ Clients
Returns a new instance of Clients.
21 22 23 24 25 |
# File 'lib/checkoff/clients.rb', line 21 def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana), asana_client_class: Asana::Client) @config = config @asana_client_class = asana_client_class end |
Class Method Details
Instance Method Details
#client ⇒ Asana::Client
28 29 30 31 32 33 34 |
# File 'lib/checkoff/clients.rb', line 28 def client @client ||= @asana_client_class.new do |c| c.authentication :access_token, @config.fetch(:personal_access_token) c.default_headers 'asana-enable' => 'new_project_templates,new_user_task_lists,new_memberships,new_goal_memberships' end end |