Sha256: 0630e9d2d05196ca7f6ef53a09db8d3b2ec3387bc5aba3ab091a44c12f98028d
Contents?: true
Size: 441 Bytes
Versions: 10
Compression:
Stored size: 441 Bytes
Contents
# 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
Version data entries
10 entries across 10 versions & 1 rubygems