class Qonfig::Loaders::JSON
@api private @since 0.5.0
Public Class Methods
load(data)
click to toggle source
@param data [String] @return [Object]
@raise [Qonfig::JSONLoaderParseError]
@api private @since 0.5.0 @version 0.26.0
# File lib/qonfig/loaders/json.rb, line 15 def load(data) ::JSON.parse(ERB.new(data).result, max_nesting: false, allow_nan: true) rescue ::JSON::ParserError => error raise(Qonfig::JSONLoaderParseError.new(error.message).tap do |exception| exception.set_backtrace(error.backtrace) end) end
load_empty_data()
click to toggle source
@return [Object]
@api private @since 0.5.0
# File lib/qonfig/loaders/json.rb, line 27 def load_empty_data load('{}') end