Class: Qonfig::Loaders::Dynamic Private

Inherits:
Basic
  • Object
show all
Defined in:
lib/qonfig/loaders/dynamic.rb,
lib/qonfig/plugins/toml/loaders/dynamic.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.

Since:

  • 0.17.0

Class Method Summary collapse

Methods inherited from Basic

load_file

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.

Parameters:

  • data (String)

Returns:

  • (Object)

Raises:

Since:

  • 0.17.0



14
15
16
17
18
19
20
21
22
# File 'lib/qonfig/loaders/dynamic.rb', line 14

def load(data)
  try_to_load_json_data(data)
rescue Qonfig::JSONLoaderParseError
  begin
    try_to_load_yaml_data(data)
  rescue Qonfig::YAMLLoaderParseError
    raise Qonfig::DynamicLoaderParseError, 'File data has unknown format'
  end
end

.load_empty_dataHash

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.

Returns:

  • (Hash)

Since:

  • 0.17.0



28
29
30
# File 'lib/qonfig/loaders/dynamic.rb', line 28

def load_empty_data
  {}
end