package mantra.io
Environment
CLASS
public class
Operating system process environment variable accessor and loader for .env configuration files.
🏗️ Constructor Summary
Constructor Signature
def __init__(self)
⚙️ Method Summary
| Modifier & Return Type | Method Signature | Description |
|---|---|---|
String |
get(key: String, default_val: String) |
Queries environment table by key; returns fallback if missing. |
Bool |
has(key: String) |
Returns True if variable is present in process env. |
🔍 Detailed Method Specifications
pub def get(key: String, default_val: String) -> String
Queries environment table by key; returns fallback if missing.
pub def has(key: String) -> Bool
Returns True if variable is present in process env.
💡 Example Usage
environment_example.mantra
let db_port = Environment.get("PORT", "3306")