Class: Codebreaker::GuessChecker
- Inherits:
-
Object
- Object
- Codebreaker::GuessChecker
- Defined in:
- lib/codebreaker/guess_checker.rb
Constant Summary collapse
- MINUSE =
'-'
- PLUS =
'+'
- NONE =
' '
Instance Attribute Summary collapse
-
#exact ⇒ Object
Returns the value of attribute exact.
-
#inexact ⇒ Object
Returns the value of attribute inexact.
-
#none ⇒ Object
Returns the value of attribute none.
Instance Method Summary collapse
- #check_input ⇒ Object
-
#initialize(code, code_input) ⇒ GuessChecker
constructor
A new instance of GuessChecker.
- #symbols(inexact = MINUSE, exact = PLUS, none = NONE) ⇒ Object
Constructor Details
#initialize(code, code_input) ⇒ GuessChecker
Returns a new instance of GuessChecker.
11 12 13 14 |
# File 'lib/codebreaker/guess_checker.rb', line 11 def initialize(code, code_input) @code = code.chars @code_input = code_input.chars end |
Instance Attribute Details
#exact ⇒ Object
Returns the value of attribute exact.
5 6 7 |
# File 'lib/codebreaker/guess_checker.rb', line 5 def exact @exact end |
#inexact ⇒ Object
Returns the value of attribute inexact.
5 6 7 |
# File 'lib/codebreaker/guess_checker.rb', line 5 def inexact @inexact end |
#none ⇒ Object
Returns the value of attribute none.
5 6 7 |
# File 'lib/codebreaker/guess_checker.rb', line 5 def none @none end |
Instance Method Details
#check_input ⇒ Object
22 23 24 25 26 |
# File 'lib/codebreaker/guess_checker.rb', line 22 def check_input raw_result = mismatched matched_result = matched(raw_result) check_result(matched_result) end |