class Qonfig::Loaders::YAML

@api private @since 0.2.0

Public Class Methods

load(data) click to toggle source

@param data [String] @return [Object]

@raise [Qonfig::YAMLLoaderParseError]

@api private @since 0.2.0

# File lib/qonfig/loaders/yaml.rb, line 14
def load(data)
  ::YAML.load(ERB.new(data).result)
rescue ::Psych::SyntaxError => error
  raise(
    Qonfig::YAMLLoaderParseError.new(
      error.file,
      error.line,
      error.column,
      error.offset,
      error.problem,
      error.context
    ).tap { |exception| exception.set_backtrace(error.backtrace) }
  )
end
load_empty_data() click to toggle source

@return [Object]

@api private @since 0.5.0

# File lib/qonfig/loaders/yaml.rb, line 33
def load_empty_data
  load('{}')
end