Class: Azure::Directory::Config
- Inherits:
-
Object
- Object
- Azure::Directory::Config
- Defined in:
- lib/azure/directory/config.rb
Defined Under Namespace
Classes: Builder
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#resource_id ⇒ Object
readonly
Returns the value of attribute resource_id.
-
#scope_name ⇒ Object
readonly
Returns the value of attribute scope_name.
-
#tenant_id ⇒ Object
readonly
Returns the value of attribute tenant_id.
Instance Method Summary collapse
-
#initialize(scope_name = :main) ⇒ Config
constructor
A new instance of Config.
- #load_token ⇒ Object
- #save_token(token_hash) ⇒ Object
- #using(scope) ⇒ Object
Constructor Details
#initialize(scope_name = :main) ⇒ Config
Returns a new instance of Config.
27 28 29 |
# File 'lib/azure/directory/config.rb', line 27 def initialize(scope_name = :main) @scope_name = scope_name end |
Instance Attribute Details
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
25 26 27 |
# File 'lib/azure/directory/config.rb', line 25 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
25 26 27 |
# File 'lib/azure/directory/config.rb', line 25 def client_secret @client_secret end |
#resource_id ⇒ Object (readonly)
Returns the value of attribute resource_id.
25 26 27 |
# File 'lib/azure/directory/config.rb', line 25 def resource_id @resource_id end |
#scope_name ⇒ Object (readonly)
Returns the value of attribute scope_name.
25 26 27 |
# File 'lib/azure/directory/config.rb', line 25 def scope_name @scope_name end |
#tenant_id ⇒ Object (readonly)
Returns the value of attribute tenant_id.
25 26 27 |
# File 'lib/azure/directory/config.rb', line 25 def tenant_id @tenant_id end |
Instance Method Details
#load_token ⇒ Object
41 42 43 |
# File 'lib/azure/directory/config.rb', line 41 def load_token @token_store and @token_store.load(@scope_name) end |
#save_token(token_hash) ⇒ Object
36 37 38 39 |
# File 'lib/azure/directory/config.rb', line 36 def save_token(token_hash) token_hash = token_hash.slice('access_token', 'token_type', 'expires_at') @token_store and @token_store.save(@scope_name, token_hash) end |
#using(scope) ⇒ Object
31 32 33 |
# File 'lib/azure/directory/config.rb', line 31 def using(scope) @scopes[scope] end |