# frozen_string_literal: true module CodebreakerRuban class Storage FILE_NAME = './lib/app/store/store.yml' class << self def save_in_store(obj) File.open(FILE_NAME, 'a') { |file| file.write obj.to_yaml } end def load_storage store_exists? ? YAML.load_stream(File.read(FILE_NAME)) : [] end private def store_exists? File.exist?(FILE_NAME) end end end end