module Loader

Public Instance Methods

read_achievements() click to toggle source
# File lib/codebreaker_gem/loader.rb, line 9
def read_achievements
  File.readlines('./data/data.yml')
end
save_achievement(scores) click to toggle source
# File lib/codebreaker_gem/loader.rb, line 3
def save_achievement(scores)
  File.open('./data/data.yml', 'a') do |f|
    f.puts "name: #{scores[:user_name]} attempts: #{scores[:attempts]} hints: #{scores[:hints]} secret_code: #{scores[:secret_code]}"
  end
end