Class: Pcrd::Config::Loader
- Inherits:
-
Object
- Object
- Pcrd::Config::Loader
- Defined in:
- lib/pcrd/config/loader.rb
Class Method Summary collapse
-
.load(path) ⇒ Object
Returns a Config::Root.
Instance Method Summary collapse
-
#initialize(path) ⇒ Loader
constructor
A new instance of Loader.
- #load ⇒ Object
Constructor Details
#initialize(path) ⇒ Loader
Returns a new instance of Loader.
22 23 24 |
# File 'lib/pcrd/config/loader.rb', line 22 def initialize(path) @path = path end |
Class Method Details
.load(path) ⇒ Object
Returns a Config::Root. Raises Config::LoadError on any problem.
18 19 20 |
# File 'lib/pcrd/config/loader.rb', line 18 def self.load(path) new(path).load end |
Instance Method Details
#load ⇒ Object
26 27 28 29 30 31 |
# File 'lib/pcrd/config/loader.rb', line 26 def load raw = read_file data = parse_yaml(raw) validate!(data) build(data) end |