class AndriiCodebreaker::DbYaml

Public Class Methods

load_file(path) click to toggle source
# File lib/andrii_codebreaker/model.rb, line 6
def load_file(path)
  File.open(path, 'r') do |filename|
    YAML.safe_load(filename)
  end
end
load_file_stats(path) click to toggle source
# File lib/andrii_codebreaker/model.rb, line 16
def load_file_stats(path)
  YAML.load_stream(File.open(path))
end
save(user, path) click to toggle source
# File lib/andrii_codebreaker/model.rb, line 12
def save(user, path)
  File.open(path, 'a') { |f| YAML.dump(user, f) }
end