Class: Configurate::Provider::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/configurate/provider.rb

Overview

This provides a basic #lookup method for other providers to build upon. Childs are expected to define lookup_path(path, *args). The method should return nil if the setting wasn't found and #lookup will raise an SettingNotFoundError in that case.

Direct Known Subclasses

Dynamic, Env, YAML

Instance Method Summary collapse

Instance Method Details

#lookup(*args) ⇒ Object


9
10
11
12
13
# File 'lib/configurate/provider.rb', line 9

def lookup(*args)
  result = lookup_path(*args)
  return result unless result.nil?
  raise Configurate::SettingNotFoundError, "The setting #{args.first} was not found"
end