Class: SimpleGdrive::Authorizer
- Inherits:
-
Object
- Object
- SimpleGdrive::Authorizer
- Defined in:
- lib/simple_gdrive/authorizer.rb
Constant Summary collapse
- OOB_URI =
'urn:ietf:wg:oauth:2.0:oob'.freeze
- DEFAULT_USER_ID =
'default'.freeze
- API_SCOPE =
[Google::Apis::DriveV3::AUTH_DRIVE].freeze
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.call ⇒ Object
22 23 24 |
# File 'lib/simple_gdrive/authorizer.rb', line 22 def self.call new.call end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/simple_gdrive/authorizer.rb', line 12 def call FileUtils.mkdir_p File.dirname(::SimpleGdrive.config.credential_file) credentials = .get_credentials(DEFAULT_USER_ID) # FIXME: rails? credentials = request_credentials if credentials.nil? && defined?(Rails::Console) credentials end |