class Settings::Yaml

Attributes

data[R]
path[R]

file path

Public Class Methods

load(path = nil) click to toggle source
# File lib/configurates/provider/yaml.rb, line 11
def self.load(path = nil)
  path ||= '../configs/default.yml'
  new(path)
end
new(path) click to toggle source
# File lib/configurates/provider/yaml.rb, line 23
def initialize(path)
  @path = File.absolute_path(path)
  begin
    @data = YAML.load_file(@path)
  rescue Errno::ENOENT
    msg = "file with path: #{@path} not found!"
    raise FileNotFound, msg
  end
end