Class: Remocon::Command::GetToken
- Inherits:
-
Object
- Object
- Remocon::Command::GetToken
- Defined in:
- lib/remocon/command/get_token_command.rb
Instance Attribute Summary collapse
-
#cmd_opts ⇒ Object
readonly
Returns the value of attribute cmd_opts.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(opts) ⇒ GetToken
constructor
A new instance of GetToken.
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#cmd_opts ⇒ Object (readonly)
Returns the value of attribute cmd_opts.
6 7 8 |
# File 'lib/remocon/command/get_token_command.rb', line 6 def cmd_opts @cmd_opts end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/remocon/command/get_token_command.rb', line 6 def config @config end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/remocon/command/get_token_command.rb', line 13 def run = Google::Auth::ServiceAccountCredentials.make_creds( json_key_io: File.open(config.service_json_file_path), scope: "https://www.googleapis.com/auth/firebase.remoteconfig" ) .fetch_access_token! STDOUT.puts .access_token .access_token end |