Sha256: bfd337bdc606011c4e338b668eb3361ef8635f0a3574c512e6d50862f8b64147

Contents?: true

Size: 525 Bytes

Versions: 6

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

module Codebreakergem
  class Statistic
    attr_accessor :name, :difficulty, :attempts_total,
                  :attempts_used, :hints_total, :hints_used

    def initialize(name:, difficulty:, attempts_total:, hints_total:)
      @name = name
      @difficulty = difficulty
      @attempts_total = attempts_total
      @attempts_used = attempts_total - difficulty.attempts
      @hints_total = hints_total
      @hints_used = hints_total - difficulty.hints
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
codebreakergem-0.1.11 lib/classes/statistic.rb
codebreakergem-0.1.10 lib/classes/statistic.rb
codebreakergem-0.1.6 lib/classes/statistic.rb
codebreakergem-0.1.5 lib/classes/statistic.rb
codebreakergem-0.1.4 lib/classes/statistic.rb
codebreakergem-0.1.3 lib/classes/statistic.rb