Class: Upwork::Api::Config
- Inherits:
-
Object
- Object
- Upwork::Api::Config
- Defined in:
- lib/upwork/api/config.rb
Overview
Config storage
Constant Summary collapse
- @@debug =
false
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#expires_in ⇒ Object
Returns the value of attribute expires_in.
-
#grant_type ⇒ Object
readonly
Returns the value of attribute grant_type.
-
#redirect_uri ⇒ Object
readonly
Returns the value of attribute redirect_uri.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
Instance Method Summary collapse
-
#debug ⇒ Object
Get debug status.
-
#initialize(config = {}) ⇒ Config
constructor
Init config object.
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_token ⇒ Object
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_id ⇒ Object (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_secret ⇒ Object (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_at ⇒ Object
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_in ⇒ Object
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_type ⇒ Object (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_uri ⇒ Object (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_token ⇒ Object
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
#debug ⇒ Object
Get debug status
36 37 38 |
# File 'lib/upwork/api/config.rb', line 36 def debug # :nodoc: @@debug end |