class PolyglotFlutter::Command::Login
Public Class Methods
init()
click to toggle source
# File lib/flutter_polyglot_cli/commands/login.rb, line 6 def self.init new.call end
Public Instance Methods
call()
click to toggle source
# File lib/flutter_polyglot_cli/commands/login.rb, line 10 def call PolyglotFlutter::IO::Token.write(token) end
Private Instance Methods
email()
click to toggle source
# File lib/flutter_polyglot_cli/commands/login.rb, line 22 def email prompt.ask('Email:') { |value| value.validate :email } end
password()
click to toggle source
# File lib/flutter_polyglot_cli/commands/login.rb, line 26 def password prompt.mask('Password:') end
token()
click to toggle source
# File lib/flutter_polyglot_cli/commands/login.rb, line 16 def token prompt.say('Logging into API...') @data = PolyglotFlutter::Resource::Session.create(email: email, password: password) @data.token end