Class: Pcli::Services::Commands::Logout

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/pcli/services/commands/logout.rb

Instance Method Summary collapse

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/pcli/services/commands/logout.rb', line 9

def call(*)
  unless api.token
    output.puts('You are not logged in.')
    return
  end

  api.token = nil

  output.puts(Pl.green('Logged out.'))

  CommandOutput.continue
end