Class: CloudParty::Config
- Inherits:
-
Object
- Object
- CloudParty::Config
- Defined in:
- lib/cloud_party/config.rb
Class Method Summary collapse
-
.api_key ⇒ String
The api key string.
-
.email ⇒ String
The email string.
-
.token ⇒ String
The cloudflare api token.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cloud_party/config.rb', line 6 def initialize cp_config = AppConfiguration.new('config') do base_local_path Pathname.new(Dir.home).join('.cloud_party/') base_global_path Pathname.new(Etc.sysconfdir).join('cloud_party') use_env_variables true prefix 'CLOUD_PARTY' end cfcli_config = AppConfiguration.new('config') do base_local_path Pathname.new(Dir.home).join('.cfcli/') base_global_path Pathname.new(Etc.sysconfdir).join('cloudflare_cli') use_env_variables true prefix 'CFCLI' end @@email = cp_config.email || cfcli_config.email @@api_key = cp_config.api_key || cfcli_config.api_key @@token = cp_config.token || cfcli_config.token end |
Class Method Details
.api_key ⇒ String
Returns the api key string.
30 31 32 |
# File 'lib/cloud_party/config.rb', line 30 def self.api_key @@api_key end |
.email ⇒ String
Returns the email string.
25 26 27 |
# File 'lib/cloud_party/config.rb', line 25 def self.email @@email end |
.token ⇒ String
Returns the cloudflare api token.
35 36 37 |
# File 'lib/cloud_party/config.rb', line 35 def self.token @@token end |