Class: GoogleSpreadsheetFetcher::Authorizer::Oauth2::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/google_spreadsheet_fetcher/authorizer/oauth2/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_secrets_json_path: nil, user_id: nil, token_store: nil) ⇒ Config

Returns a new instance of Config.



7
8
9
10
11
12
13
14
# File 'lib/google_spreadsheet_fetcher/authorizer/oauth2/config.rb', line 7

def initialize(client_secrets_json_path: nil, user_id: nil, token_store: nil)
  @client_secrets_json_path = client_secrets_json_path || ::GoogleSpreadsheetFetcher.config.client_secrets_file
  @user_id = user_id || ::GoogleSpreadsheetFetcher.config.user_id
  @token_store = token_store || default_token_store
  @client_id = ::Google::Auth::ClientId.from_file(self.client_secrets_json_path)

  freeze
end

Instance Attribute Details

#client_idObject (readonly)

Returns the value of attribute client_id.



5
6
7
# File 'lib/google_spreadsheet_fetcher/authorizer/oauth2/config.rb', line 5

def client_id
  @client_id
end

#client_secrets_json_pathObject (readonly)

Returns the value of attribute client_secrets_json_path.



5
6
7
# File 'lib/google_spreadsheet_fetcher/authorizer/oauth2/config.rb', line 5

def client_secrets_json_path
  @client_secrets_json_path
end

#token_storeObject (readonly)

Returns the value of attribute token_store.



5
6
7
# File 'lib/google_spreadsheet_fetcher/authorizer/oauth2/config.rb', line 5

def token_store
  @token_store
end

#user_idObject (readonly)

Returns the value of attribute user_id.



5
6
7
# File 'lib/google_spreadsheet_fetcher/authorizer/oauth2/config.rb', line 5

def user_id
  @user_id
end