Sha256: dc00d45a4863cda7742cfc2270200fcb7609848d4a1e7628551dd13f95a83ce1

Contents?: true

Size: 523 Bytes

Versions: 3

Compression:

Stored size: 523 Bytes

Contents

# frozen_string_literal: true

module Codebreakergem
  class Statistic
    attr_reader :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

3 entries across 3 versions & 1 rubygems

Version Path
codebreakergem-0.1.12 lib/classes/statistic.rb
codebreakergem-0.1.9 lib/classes/statistic.rb
codebreakergem-0.1.8 lib/classes/statistic.rb