class

Qtr::Config

Inherits JSON::Serializable < YAML::Serializable < Reference < Object

Root configuration container

Constructors

load(file_path : String | Nil = nil) : Config

Loads configuration applying strict cascade:

  1. Specified file path
  2. Local ./qtr.yaml or ./.qtr.yaml
  3. User config ~/.config/qtr/config.yaml
  4. Fallback defaults Followed by environment variable overlays.
new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
new(pull : JSON::PullParser)
new(organization : OrgConfig = OrgConfig.new, contact : ContactConfig = ContactConfig.new, rates : RatesConfig = RatesConfig.new, currency : CurrencyConfig = CurrencyConfig.new, pdf : PdfConfig = PdfConfig.new)
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
new(*, __pull_for_json_serializable pull : JSON::PullParser)

Instance methods

contact
contact=(contact : ContactConfig)
currency
currency=(currency : CurrencyConfig)
organization
organization=(organization : OrgConfig)
pdf
pdf=(pdf : PdfConfig)
rate_for(tier : RateTier) : Float64

Resolves rate according to RateTier

rates
rates=(rates : RatesConfig)
to_yaml_document

Serializes configuration to a formal YAML document beginning with '---' and ending with '...'