Class: TrelloFlow::GlobalConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/trello_flow/global_config.rb

Constant Summary collapse

PATH =
ENV["HOME"] + "/.trello_flow"

Instance Method Summary collapse

Constructor Details

#initialize(store = nil) ⇒ GlobalConfig

Returns a new instance of GlobalConfig.



8
9
10
# File 'lib/trello_flow/global_config.rb', line 8

def initialize(store = nil)
  @store = store || ConfigStore.new(PATH)
end

Instance Method Details

#keyObject



12
13
14
# File 'lib/trello_flow/global_config.rb', line 12

def key
  @_key ||= store[:key] || configure_key
end

#tokenObject



16
17
18
# File 'lib/trello_flow/global_config.rb', line 16

def token
  @_token ||= store[:token] || configure_token
end