Class: GoogleDirectory::Config
- Inherits:
-
Object
- Object
- GoogleDirectory::Config
- Defined in:
- lib/google-directory/config.rb
Defined Under Namespace
Classes: Builder
Instance Attribute Summary collapse
-
#admin_email ⇒ Object
readonly
Returns the value of attribute admin_email.
-
#application_name ⇒ Object
readonly
Returns the value of attribute application_name.
-
#application_version ⇒ Object
readonly
Returns the value of attribute application_version.
-
#issuer ⇒ Object
readonly
Returns the value of attribute issuer.
-
#key_file ⇒ Object
readonly
Returns the value of attribute key_file.
-
#key_passphrase ⇒ Object
readonly
Returns the value of attribute key_passphrase.
-
#scope_name ⇒ Object
readonly
Returns the value of attribute scope_name.
Instance Method Summary collapse
-
#initialize(scope_name = :main) ⇒ Config
constructor
A new instance of Config.
- #load_token ⇒ Object
-
#save_token(token_hash) ⇒ Object
token_type: issued_at: access_token: expires_in:.
- #using(scope) ⇒ Object
Constructor Details
#initialize(scope_name = :main) ⇒ Config
Returns a new instance of Config.
31 32 33 34 35 |
# File 'lib/google-directory/config.rb', line 31 def initialize(scope_name = :main) @scope_name = scope_name @application_name = 'Google Directory API' @application_version = GoogleDirectory::VERSION end |
Instance Attribute Details
#admin_email ⇒ Object (readonly)
Returns the value of attribute admin_email.
29 30 31 |
# File 'lib/google-directory/config.rb', line 29 def admin_email @admin_email end |
#application_name ⇒ Object (readonly)
Returns the value of attribute application_name.
29 30 31 |
# File 'lib/google-directory/config.rb', line 29 def application_name @application_name end |
#application_version ⇒ Object (readonly)
Returns the value of attribute application_version.
29 30 31 |
# File 'lib/google-directory/config.rb', line 29 def application_version @application_version end |
#issuer ⇒ Object (readonly)
Returns the value of attribute issuer.
29 30 31 |
# File 'lib/google-directory/config.rb', line 29 def issuer @issuer end |
#key_file ⇒ Object (readonly)
Returns the value of attribute key_file.
29 30 31 |
# File 'lib/google-directory/config.rb', line 29 def key_file @key_file end |
#key_passphrase ⇒ Object (readonly)
Returns the value of attribute key_passphrase.
29 30 31 |
# File 'lib/google-directory/config.rb', line 29 def key_passphrase @key_passphrase end |
#scope_name ⇒ Object (readonly)
Returns the value of attribute scope_name.
29 30 31 |
# File 'lib/google-directory/config.rb', line 29 def scope_name @scope_name end |
Instance Method Details
#load_token ⇒ Object
52 53 54 |
# File 'lib/google-directory/config.rb', line 52 def load_token @token_store and @token_store.load(@scope_name) end |
#save_token(token_hash) ⇒ Object
token_type: issued_at: access_token: expires_in:
47 48 49 50 |
# File 'lib/google-directory/config.rb', line 47 def save_token(token_hash) token_hash = token_hash.slice('token_type', 'issued_at', 'access_token', 'expires_in') @token_store and @token_store.save(@scope_name, token_hash) end |
#using(scope) ⇒ Object
37 38 39 |
# File 'lib/google-directory/config.rb', line 37 def using(scope) @scopes[scope] end |