Class: Cp8Cli::GlobalConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/cp8_cli/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/cp8_cli/global_config.rb', line 8

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

Instance Method Details

#github_tokenObject



20
21
22
# File 'lib/cp8_cli/global_config.rb', line 20

def github_token
  @_github_token ||= store[:github_token] || env_github_token || configure_github_token
end

#trello_keyObject



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

def trello_key
  @_trello_key ||= store[:key] || configure_trello_key
end

#trello_tokenObject



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

def trello_token
  @_trello_token ||= store[:token] || configure_trello_token
end