class GemCodebreakerAmidasd::Statistic
Attributes
date[R]
game[R]
user[R]
Public Class Methods
new(user:, game:)
click to toggle source
# File lib/gem_codebreaker_amidasd/statistic.rb, line 4 def initialize(user:, game:) @user = user @game = game @date = DateTime.now end
sort_array(array)
click to toggle source
# File lib/gem_codebreaker_amidasd/statistic.rb, line 10 def self.sort_array(array) array.sort_by! { |value| [value.game.total_count_attempt, value.game.count_attempt, value.game.count_hints] } end