Class: Harvest::OAuthCredentials

Inherits:
Object
  • Object
show all
Defined in:
lib/harvest/credentials.rb

Instance Method Summary collapse

Constructor Details

#initialize(access_token: nil, client_id: nil) ⇒ OAuthCredentials

Returns a new instance of OAuthCredentials.



20
21
22
23
# File 'lib/harvest/credentials.rb', line 20

def initialize(access_token: nil, client_id: nil)
  @access_token = access_token
  @client_id = client_id
end

Instance Method Details

#hostObject



30
31
32
# File 'lib/harvest/credentials.rb', line 30

def host
  'https://api.harvestapp.com/v2'
end

#set_authentication(request_options) ⇒ Object



25
26
27
28
# File 'lib/harvest/credentials.rb', line 25

def set_authentication(request_options)
  request_options[:query] ||= {}
  request_options[:query]["access_token"] = @access_token
end