class MergetrainCheck::AuthTokenStorage

Constants

KEYCHAIN_SERVICE_NAME

Public Class Methods

new(host) click to toggle source
# File lib/mergetrain_check/config.rb, line 9
def initialize(host)
  @host = host
  @kitem = Keychain.generic_passwords.where(service: KEYCHAIN_SERVICE_NAME).all.detect { |k| k.account == host }
  @kitem = Keychain.generic_passwords.create(service: KEYCHAIN_SERVICE_NAME, password: 'secret', account: host) if @kitem.nil?
end

Public Instance Methods

password() click to toggle source
# File lib/mergetrain_check/config.rb, line 15
def password
  return @kitem.password
end
password=(value) click to toggle source
# File lib/mergetrain_check/config.rb, line 19
def password=(value)
  @kitem.password = value
end
save!() click to toggle source
# File lib/mergetrain_check/config.rb, line 23
def save!
  @kitem.save!
end