# frozen_string_literal: true module Codebreaker class YamlMapper class << self def save(object, path) stats = load(path) stats << object File.open(path, 'w') do |file| file.write(stats.to_yaml) end end def load(path) File.file?(path) ? Psych.load(File.read(path)) : [] end end end end