module ENV
Overview
ENV
is a hash-like accessor for environment variables.
Example
# Set env var PORT to a default if not already set
ENV["PORT"] ||= "5000"
# Later use that env var.
puts ENV["PORT"].to_i
NOTE All keys and values are strings. You must take care to cast other types at runtime, e.g. integer port numbers.
Extended Modules
- Enumerable({String, String})
Defined in:
py2cr/env.crClass Method Summary
-
.py_in?(key : String) : Bool
Handles "key in os.environ" case