Class: GoogleOAuthCli
- Inherits:
-
Object
- Object
- GoogleOAuthCli
- Defined in:
- lib/google-oauth-cli.rb,
lib/google-oauth-cli/server.rb,
lib/google-oauth-cli/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"1.0.1"
Instance Method Summary collapse
-
#initialize(client_id:, client_secret:, scope:, credentials_file: nil, port: 9876) ⇒ GoogleOAuthCli
constructor
A new instance of GoogleOAuthCli.
- #login ⇒ Object
Constructor Details
#initialize(client_id:, client_secret:, scope:, credentials_file: nil, port: 9876) ⇒ GoogleOAuthCli
Returns a new instance of GoogleOAuthCli.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/google-oauth-cli.rb', line 11 def initialize(client_id:, client_secret:, scope:, credentials_file: nil, port: 9876) @credentials = Google::Auth::UserRefreshCredentials.new( client_id: client_id, client_secret: client_secret, scope: scope, redirect_uri: "http://localhost:#{port}/authorize", additional_parameters: { access_type: "offline" } ) if credentials_file @credentials_file = Pathname.new(File.(credentials_file)) @credentials_file end @port = port end |
Instance Method Details
#login ⇒ Object
26 27 28 |
# File 'lib/google-oauth-cli.rb', line 26 def login || end |