class

Superconf::AbstractOption

Inherits Reference < Object

Non-generic base so options of different value types can share one collection. Typed behavior lives in Option(T).

Constructors

new(key : String, explicit_env : Nil | String, cli : String, group : String, description : String)
Source

Instance methods

alias_target

The option an alias forwards to, or nil for a normal option. An alias (see Superconf.register_alias) shares another option's value, type, default, parsing and validation.

Source
at_default?

Whether the option still carries its registered default. Compared as the rendered string so it works uniformly for any option type; a value set equal to the default counts as "at default". The negated question ("was this configured?") is Superconf.configured?.

Source
bool?

Is the value type Bool? Governs --flag / --no-flag generation.

Source
build_alias(key : String, *, explicit_env : String | Nil, cli : String, group : String, description : String) : AbstractOption

Build an alias of this option, registered under key with its own env/CLI/group surfaces but sharing this option's value. Used by Superconf.register_alias.

Source
default_string

The registered default, rendered as a string.

Source
description
Source
emit_json(json : JSON::Builder) : Nil

Emit the current value as a native JSON value.

Source
emit_yaml(yaml : YAML::Builder) : Nil

Emit the current value as a native YAML scalar.

Source
explicit_env

Explicit env-var name, or nil to derive one lazily from the registry prefix + key (see Superconf.env_name). Lazy so the prefix can be set after options are registered (e.g. by the app, across libraries).

Source
group
Source
leaf_key

Key with its leading <group>. stripped, for grouped dumps. A key without a dot is returned unchanged.

Source
origin
Source
set_from_string(str : String, source : Source, origin : String) : Nil

Parse str and store it, honoring precedence (see Source).

Source
source
Source
stringify

Current value rendered as the string used across env/CLI/config/dumps.

Source