Class: HiEnergyAi::Configuration
- Inherits:
-
Object
- Object
- HiEnergyAi::Configuration
- Defined in:
- lib/hi_energy_ai/configuration.rb
Constant Summary collapse
- APP_ORIGIN =
"https://app.hienergy.ai"- API_BASE_URL =
"https://app.hienergy.ai/api/v1"- DOCUMENTATION_URL =
"https://app.hienergy.ai/api_documentation"- DEFAULT_TIMEOUT =
30
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#app_origin ⇒ Object
Returns the value of attribute app_origin.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#bearer_token ⇒ Object
Returns the value of attribute bearer_token.
-
#dry_run ⇒ Object
Returns the value of attribute dry_run.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
- #credentials_present? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 |
# File 'lib/hi_energy_ai/configuration.rb', line 12 def initialize @app_origin = APP_ORIGIN @base_url = API_BASE_URL @timeout = DEFAULT_TIMEOUT @dry_run = false @user_agent = "hi_energy_ai/#{HiEnergyAi::VERSION} (Ruby #{RUBY_VERSION})" end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
10 11 12 |
# File 'lib/hi_energy_ai/configuration.rb', line 10 def api_key @api_key end |
#app_origin ⇒ Object
Returns the value of attribute app_origin.
10 11 12 |
# File 'lib/hi_energy_ai/configuration.rb', line 10 def app_origin @app_origin end |
#base_url ⇒ Object
Returns the value of attribute base_url.
10 11 12 |
# File 'lib/hi_energy_ai/configuration.rb', line 10 def base_url @base_url end |
#bearer_token ⇒ Object
Returns the value of attribute bearer_token.
10 11 12 |
# File 'lib/hi_energy_ai/configuration.rb', line 10 def bearer_token @bearer_token end |
#dry_run ⇒ Object
Returns the value of attribute dry_run.
10 11 12 |
# File 'lib/hi_energy_ai/configuration.rb', line 10 def dry_run @dry_run end |
#timeout ⇒ Object
Returns the value of attribute timeout.
10 11 12 |
# File 'lib/hi_energy_ai/configuration.rb', line 10 def timeout @timeout end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
10 11 12 |
# File 'lib/hi_energy_ai/configuration.rb', line 10 def user_agent @user_agent end |
Instance Method Details
#credentials_present? ⇒ Boolean
20 21 22 |
# File 'lib/hi_energy_ai/configuration.rb', line 20 def credentials_present? !api_key.to_s.empty? || !bearer_token.to_s.empty? end |