Sha256: 1f73d54b75e919108963cc67ad413150f70ea24be3af67c0c71d20f9ff010a66
Contents?: true
Size: 482 Bytes
Versions: 2
Compression:
Stored size: 482 Bytes
Contents
# frozen_string_literal: true class Difficulty < BaseClass LEVELS = { easy: { attempts: 15, hints: 3, name: 'easy', id: 1 }, medium: { attempts: 10, hints: 2, name: 'medium', id: 2 }, hell: { attempts: 5, hints: 1, name: 'hell', id: 3 } }.freeze attr_reader :errors, :level def initialize(level = :easy) @level = LEVELS[level.to_sym] @errors = [] end def validate @errors << 'unexpected_comand' unless LEVELS.values.include? @level end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
codebreaker_gapdn-0.1.1 | lib/entities/difficulty.rb |
codebreaker_gapdn-0.1.0 | lib/entities/difficulty.rb |