lib/andrii_codebreaker/model.rb in andrii_codebreaker-0.1.0 vs lib/andrii_codebreaker/model.rb in andrii_codebreaker-0.1.1

- old
+ new

@@ -7,16 +7,16 @@ save_data(file) rescue Errno::ENOENT nil end + def save(user, file) + File.open(file, 'a') { |f| YAML.dump(user, f) } + end + def save_data(file) File.open(file, 'r') do |filename| YAML.safe_load(filename) end - end - - def save(user, file) - File.open(file, 'a') { |f| YAML.dump(user, f) } end end end