module NewSuperCodebreaker2021::ShowContent

Public Instance Methods

show_stats(file) click to toggle source
# File lib/new_super_codebreaker_2021/show_content.rb, line 3
def show_stats(file)
  data = YAML.load_file(file) || []
  data.sort_by! { |game| [-game.difficulty, game.attempts_used, game.hints_used] }
rescue Errno::ENOENT
  []
end