Class: Qonfig::Loaders::Basic Private
- Inherits:
-
Object
- Object
- Qonfig::Loaders::Basic
- Defined in:
- lib/qonfig/loaders/basic.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
rubocop:disable Style/StaticClass
Class Method Summary collapse
- .load(data) ⇒ void private
- .load_empty_data ⇒ void private
- .load_file(file_path, fail_on_unexist: true) ⇒ Object private
Class Method Details
.load(data) ⇒ void
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.
This method returns an undefined value.
13 14 15 |
# File 'lib/qonfig/loaders/basic.rb', line 13 def load(data) nil # NOTE: consciously return nil (for clarity) end |
.load_empty_data ⇒ void
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.
This method returns an undefined value.
21 22 23 |
# File 'lib/qonfig/loaders/basic.rb', line 21 def load_empty_data nil # NOTE: consciously return nil (for clarity) 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.
33 34 35 36 37 |
# File 'lib/qonfig/loaders/basic.rb', line 33 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_empty_data end |