Class: PolyglotFlutter::IO::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/flutter_polyglot_cli/io/token.rb

Constant Summary collapse

KEYCHAIN_SERVICE =
'polyglot'
KEYCHAIN_TOKEN_KEY =
'polyglot_token'

Class Method Summary collapse

Class Method Details

.keychainObject



16
17
18
# File 'lib/flutter_polyglot_cli/io/token.rb', line 16

def keychain
  @keychain ||= OSXKeychain.new
end

.readObject



12
13
14
# File 'lib/flutter_polyglot_cli/io/token.rb', line 12

def read
  keychain[KEYCHAIN_SERVICE, KEYCHAIN_TOKEN_KEY]
end

.write(token) ⇒ Object



8
9
10
# File 'lib/flutter_polyglot_cli/io/token.rb', line 8

def write(token)
  keychain[KEYCHAIN_SERVICE, KEYCHAIN_TOKEN_KEY] = token
end