Class: Anyway::Loaders::Env

Inherits:
Base
  • Object
show all
Defined in:
lib/anyway/loaders/env.rb

Instance Method Summary collapse

Methods inherited from Base

call, #initialize, #use_local?

Methods included from Tracing

capture, current_trace, current_trace_source, source_stack, trace!, trace_stack, with_trace_source

Constructor Details

This class inherits a constructor from Anyway::Loaders::Base

Instance Method Details

#call(env_prefix:, **_options) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/anyway/loaders/env.rb', line 8

def call(env_prefix:, **_options)
  env = ::Anyway::Env.new(type_cast: ::Anyway::NoCast)

  env.fetch_with_trace(env_prefix).then do |(conf, trace)|
    Tracing.current_trace&.merge!(trace)
    conf
  end
end