Sha256: fa0a3b73729f729f9fbe29df78d9bc5db37a05df37193c58fa6340daabe58261

Contents?: true

Size: 565 Bytes

Versions: 8

Compression:

Stored size: 565 Bytes

Contents

module PolyglotIos
  module Command
    class Login
      include Helper::Terminal

      def self.init
        new.call
      end

      def call
        PolyglotIos::IO::Token.write(token)
      end

      private

      def token
        prompt.say('Logging into API...')
        @data = PolyglotIos::Resource::Session.create(email: email, password: password)
        @data.token
      end

      def email
        prompt.ask('Email:') { |value| value.validate :email }
      end

      def password
        prompt.mask('Password:')
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ios_polyglot_cli-2.4.0 lib/ios_polyglot_cli/commands/login.rb
ios_polyglot_cli-2.3.0 lib/ios_polyglot_cli/commands/login.rb
ios_polyglot_cli-2.2.2 lib/ios_polyglot_cli/commands/login.rb
ios_polyglot_cli-2.2.1 lib/ios_polyglot_cli/commands/login.rb
ios_polyglot_cli-2.2.0 lib/ios_polyglot_cli/commands/login.rb
ios_polyglot_cli-2.1.1 lib/ios_polyglot_cli/commands/login.rb
ios_polyglot_cli-2.1.0 lib/ios_polyglot_cli/commands/login.rb
ios_polyglot_cli-2.0.1 lib/ios_polyglot_cli/commands/login.rb