Class: Cp8Cli::GlobalConfig
- Inherits:
-
Object
- Object
- Cp8Cli::GlobalConfig
- Defined in:
- lib/cp8_cli/global_config.rb
Constant Summary collapse
- PATH =
ENV["HOME"] + "/.trello_flow"
Instance Method Summary collapse
- #github_token ⇒ Object
-
#initialize(store = nil) ⇒ GlobalConfig
constructor
A new instance of GlobalConfig.
- #trello_key ⇒ Object
- #trello_token ⇒ Object
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_token ⇒ Object
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_key ⇒ Object
12 13 14 |
# File 'lib/cp8_cli/global_config.rb', line 12 def trello_key @_trello_key ||= store[:key] || configure_trello_key end |
#trello_token ⇒ Object
16 17 18 |
# File 'lib/cp8_cli/global_config.rb', line 16 def trello_token @_trello_token ||= store[:token] || configure_trello_token end |