Class: Daytona::Config
- Inherits:
-
Object
- Object
- Daytona::Config
- Defined in:
- lib/daytona/config.rb
Constant Summary collapse
- API_URL =
'https://app.daytona.io/api'
Instance Attribute Summary collapse
-
#api_key ⇒ String?
API key for authentication with the Daytona API.
-
#api_url ⇒ String?
URL of the Daytona API.
-
#jwt_token ⇒ String?
JWT token for authentication with the Daytona API.
-
#organization_id ⇒ String?
Organization ID for authentication with the Daytona API.
-
#target ⇒ String?
Target environment for sandboxes.
Instance Method Summary collapse
-
#initialize(api_key: nil, jwt_token: nil, api_url: nil, organization_id: nil, target: nil) ⇒ Config
constructor
Initializes a new Daytona::Config object.
Constructor Details
#initialize(api_key: nil, jwt_token: nil, api_url: nil, organization_id: nil, target: nil) ⇒ Config
Initializes a new Daytona::Config object.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/daytona/config.rb', line 41 def initialize( api_key: nil, jwt_token: nil, api_url: nil, organization_id: nil, target: nil ) # Load environment variables from .env and .env.local files # Files are loaded from the current working directory (where the code is executed) load_env_files @api_key = api_key || ENV.fetch('DAYTONA_API_KEY', nil) @jwt_token = jwt_token || ENV.fetch('DAYTONA_JWT_TOKEN', nil) @api_url = api_url || ENV.fetch('DAYTONA_API_URL', API_URL) @target = target || ENV.fetch('DAYTONA_TARGET', nil) @organization_id = organization_id || ENV.fetch('DAYTONA_ORGANIZATION_ID', nil) end |
Instance Attribute Details
#api_key ⇒ String?
API key for authentication with the Daytona API
12 13 14 |
# File 'lib/daytona/config.rb', line 12 def api_key @api_key end |
#api_url ⇒ String?
URL of the Daytona API
22 23 24 |
# File 'lib/daytona/config.rb', line 22 def api_url @api_url end |
#jwt_token ⇒ String?
JWT token for authentication with the Daytona API
17 18 19 |
# File 'lib/daytona/config.rb', line 17 def jwt_token @jwt_token end |
#organization_id ⇒ String?
Organization ID for authentication with the Daytona API
27 28 29 |
# File 'lib/daytona/config.rb', line 27 def organization_id @organization_id end |
#target ⇒ String?
Target environment for sandboxes
32 33 34 |
# File 'lib/daytona/config.rb', line 32 def target @target end |