Module: Qonfig::Loaders::YAML Private
- Defined in:
- lib/qonfig/loaders/yaml.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
Class Method Details
.load(data) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 |
# File 'lib/qonfig/loaders/yaml.rb', line 14 def load(data) ::YAML.load(ERB.new(data).result) end |
.load_file(file_path, fail_on_unexist: true) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 29 30 |
# File 'lib/qonfig/loaders/yaml.rb', line 26 def load_file(file_path, fail_on_unexist: true) load(::File.read(file_path)) rescue Errno::ENOENT => error fail_on_unexist ? (raise Qonfig::FileNotFoundError, error.) : load('{}') end |