Module: AndriiCodebreaker::Statistic
Constant Summary
Constants included from Constant
Constant::CODE_LENGTH, Constant::CODE_LENGTH_COUNT, Constant::CODE_START_LENGTH, Constant::DIFFICULTY, Constant::DIFFICULTY_SORT, Constant::LALA, Constant::MINUS, Constant::NAME_MAX_LENGTH, Constant::NAME_MIN_LENGTH, Constant::PLUS, Constant::RANGE_SECRET_CODE, Constant::WIN
Instance Method Summary collapse
Instance Method Details
#statistics ⇒ Object
7 8 9 10 |
# File 'lib/andrii_codebreaker/statistic.rb', line 7 def statistics data = DbYaml.load_file_stats('result.yml') data.sort_by { |item| [-DIFFICULTY_SORT[item.difficulties.name.to_sym], item.used_attempts, item.used_hints] } end |