Class: Upwork::Api::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/upwork/api/config.rb

Overview

Config storage

Constant Summary collapse

@@debug =
false

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Config

Init config object

Arguments:

config: (Hash)


27
28
29
30
31
32
33
# File 'lib/upwork/api/config.rb', line 27

def initialize(config = {})
  @client_id, @client_secret, @redirect_uri, @grant_type = config['client_id'], config['client_secret'], config['redirect_uri'], config['grant_type']
  @access_token, @refresh_token, @expires_in, @expires_at = config['access_token'], config['refresh_token'], config['expires_in'], config['expires_at']
  @@debug = config['debug']

  $DEBUG = self.debug
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



20
21
22
# File 'lib/upwork/api/config.rb', line 20

def access_token
  @access_token
end

#client_idObject (readonly)

Returns the value of attribute client_id.



21
22
23
# File 'lib/upwork/api/config.rb', line 21

def client_id
  @client_id
end

#client_secretObject (readonly)

Returns the value of attribute client_secret.



21
22
23
# File 'lib/upwork/api/config.rb', line 21

def client_secret
  @client_secret
end

#expires_atObject

Returns the value of attribute expires_at.



20
21
22
# File 'lib/upwork/api/config.rb', line 20

def expires_at
  @expires_at
end

#expires_inObject

Returns the value of attribute expires_in.



20
21
22
# File 'lib/upwork/api/config.rb', line 20

def expires_in
  @expires_in
end

#grant_typeObject (readonly)

Returns the value of attribute grant_type.



21
22
23
# File 'lib/upwork/api/config.rb', line 21

def grant_type
  @grant_type
end

#redirect_uriObject (readonly)

Returns the value of attribute redirect_uri.



21
22
23
# File 'lib/upwork/api/config.rb', line 21

def redirect_uri
  @redirect_uri
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



20
21
22
# File 'lib/upwork/api/config.rb', line 20

def refresh_token
  @refresh_token
end

Instance Method Details

#debugObject

Get debug status



36
37
38
# File 'lib/upwork/api/config.rb', line 36

def debug # :nodoc:
  @@debug
end