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