module DbUtils
Public Class Methods
add(path, element)
click to toggle source
# File lib/utils/db_utils.rb, line 3 def self.add(path, element) File.open(path, 'w') do |file| file.write(element.to_yaml) end end
get(path)
click to toggle source
# File lib/utils/db_utils.rb, line 9 def self.get(path) add(path, []) unless File.file?(path) YAML.load_file(path) end