Class: I28s::Cli::Configuration
- Inherits:
-
Object
- Object
- I28s::Cli::Configuration
- Defined in:
- lib/i28s/cli.rb
Constant Summary collapse
- DEFAULT_BASE_URL =
"https://i28s.dev/api/v1"
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#project_token ⇒ Object
Returns the value of attribute project_token.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/i28s/cli.rb', line 22 def initialize configuration = begin YAML.load_file(File.(".i28s.yml")) rescue Errno::ENOENT {} end @api_key = configuration["api_key"] @project_token = configuration["project_token"] @base_url = configuration["base_url"] || DEFAULT_BASE_URL end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
18 19 20 |
# File 'lib/i28s/cli.rb', line 18 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url.
18 19 20 |
# File 'lib/i28s/cli.rb', line 18 def base_url @base_url end |
#project_token ⇒ Object
Returns the value of attribute project_token.
18 19 20 |
# File 'lib/i28s/cli.rb', line 18 def project_token @project_token end |