Sha256: 227a96d95281b26280ab21ac07fd0085cf3e349bcbb6325a21234f6d300ceb58
Contents?: true
Size: 400 Bytes
Versions: 10
Compression:
Stored size: 400 Bytes
Contents
require_relative '../constants' class Difficulty include CodebreakerConstants attr_accessor :attempts, :hints, :name def initialize(name) return unless valid?(name) @name = name @hints = DIFFICULTY[name.to_sym][:hints] @attempts = DIFFICULTY[name.to_sym][:attempts] end private def valid?(name) return true if DIFFICULTY.include? name.to_sym false end end
Version data entries
10 entries across 10 versions & 1 rubygems