module SecureConf::Storage::Yaml

Public Class Methods

load(path) click to toggle source
# File lib/secure_conf/storage/yaml.rb, line 6
def self.load(path)
  if File.file?(path)
    YAML.load_file(path)
  else
    {}
  end
end
save(path, obj) click to toggle source
# File lib/secure_conf/storage/yaml.rb, line 14
def self.save(path, obj)
  h = {}
  h.replace(obj)
  YAML.dump(h, File.open(path, "w"))
end