Sha256: 560a1cc825954f110c8845c804116c5e2156d75a8bd08e5acec9a3e7a5ac7f09
Contents?: true
Size: 731 Bytes
Versions: 7
Compression:
Stored size: 731 Bytes
Contents
module NestConnect class GlobalConfig DEFAULT_PATH = ENV["HOME"] + '/.nest_connect/config' unless defined? @@path @@path = nil end def self.path=(new_path) @@path = new_path end def self.path @@path || DEFAULT_PATH end def initialize(store = nil) @store = store || ConfigStore.new(self.class.path) end def access_token @_access_token ||= store[:access_token] || configure_access_token end def access_token=(token) store.save(:access_token, token) end private attr_reader :store def configure_access_token raise 'please configure your access token first by running nest_connect authorize' end end end
Version data entries
7 entries across 7 versions & 1 rubygems