Class: TypedConfig::Loader
- Inherits:
-
Object
- Object
- TypedConfig::Loader
- Extended by:
- T::Sig
- Defined in:
- lib/typed_config/loader.rb
Instance Method Summary collapse
Instance Method Details
#load(filename) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/typed_config/loader.rb', line 12 def load(filename) return {} unless File.file?(filename) contents = File.read(filename) yaml = YAML.safe_load(ERB.new(contents).result) || {} T.cast(yaml, T::Hash[String, T.untyped]) end |