Class: Wordle::GuessValidator
- Inherits:
-
Object
- Object
- Wordle::GuessValidator
- Defined in:
- lib/wordle/guess_validator.rb
Instance Method Summary collapse
- #error ⇒ Object
-
#initialize(guess, list, difficult, must_include, must_match) ⇒ GuessValidator
constructor
A new instance of GuessValidator.
- #invalid? ⇒ Boolean
Constructor Details
#initialize(guess, list, difficult, must_include, must_match) ⇒ GuessValidator
Returns a new instance of GuessValidator.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/wordle/guess_validator.rb', line 5 def initialize( guess, list, difficult, must_include, must_match ) @guess = guess @list = list @difficult = difficult @must_include = must_include @must_match = must_match @validated = false end |
Instance Method Details
#error ⇒ Object
24 25 26 27 28 |
# File 'lib/wordle/guess_validator.rb', line 24 def error validate if !@validated @error end |
#invalid? ⇒ Boolean
20 21 22 |
# File 'lib/wordle/guess_validator.rb', line 20 def invalid? !error.nil? end |