Class: Google::ServiceAccount
- Inherits:
-
Object
- Object
- Google::ServiceAccount
- Defined in:
- lib/google/service_account.rb
Constant Summary collapse
- SCOPE =
'https://www.googleapis.com/auth/calendar'
Instance Attribute Summary collapse
-
#auth_provider_x509_cert_url ⇒ Object
readonly
Returns the value of attribute auth_provider_x509_cert_url.
-
#auth_uri ⇒ Object
readonly
Returns the value of attribute auth_uri.
-
#client_email ⇒ Object
readonly
Returns the value of attribute client_email.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_x509_cert_url ⇒ Object
readonly
Returns the value of attribute client_x509_cert_url.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#token_uri ⇒ Object
readonly
Returns the value of attribute token_uri.
Instance Method Summary collapse
-
#initialize(secret_path, email) ⇒ ServiceAccount
constructor
A new instance of ServiceAccount.
Constructor Details
#initialize(secret_path, email) ⇒ ServiceAccount
Returns a new instance of ServiceAccount.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/google/service_account.rb', line 11 def initialize(secret_path, email) JSON.parse(File.read(secret_path)).each do |key, secret| secret.each do |k, v| instance_varialbe_name = "@#{k}".to_sym instance_variable_set(instance_varialbe_name, v) end end @client_email ||= email @scope = SCOPE end |
Instance Attribute Details
#auth_provider_x509_cert_url ⇒ Object (readonly)
Returns the value of attribute auth_provider_x509_cert_url.
7 8 9 |
# File 'lib/google/service_account.rb', line 7 def auth_provider_x509_cert_url @auth_provider_x509_cert_url end |
#auth_uri ⇒ Object (readonly)
Returns the value of attribute auth_uri.
5 6 7 |
# File 'lib/google/service_account.rb', line 5 def auth_uri @auth_uri end |
#client_email ⇒ Object (readonly)
Returns the value of attribute client_email.
6 7 8 |
# File 'lib/google/service_account.rb', line 6 def client_email @client_email end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
6 7 8 |
# File 'lib/google/service_account.rb', line 6 def client_id @client_id end |
#client_x509_cert_url ⇒ Object (readonly)
Returns the value of attribute client_x509_cert_url.
7 8 9 |
# File 'lib/google/service_account.rb', line 7 def client_x509_cert_url @client_x509_cert_url end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
8 9 10 |
# File 'lib/google/service_account.rb', line 8 def project_id @project_id end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
9 10 11 |
# File 'lib/google/service_account.rb', line 9 def scope @scope end |
#token_uri ⇒ Object (readonly)
Returns the value of attribute token_uri.
5 6 7 |
# File 'lib/google/service_account.rb', line 5 def token_uri @token_uri end |