Class: Codebreaker::SecretCodeMatcher
- Inherits:
-
Object
- Object
- Codebreaker::SecretCodeMatcher
- Defined in:
- lib/codebreaker/secret_code_matcher.rb
Constant Summary collapse
- EXACT_MATCH_SYMBOL =
'+'.freeze
- DIGIT_MATCH_SYMBOL =
'-'.freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(secret_code, guess_code) ⇒ SecretCodeMatcher
constructor
A new instance of SecretCodeMatcher.
Constructor Details
#initialize(secret_code, guess_code) ⇒ SecretCodeMatcher
Returns a new instance of SecretCodeMatcher.
6 7 8 9 |
# File 'lib/codebreaker/secret_code_matcher.rb', line 6 def initialize(secret_code, guess_code) @secret_code = secret_code.dup @guess_code = guess_code.dup end |
Instance Method Details
#call ⇒ Object
11 12 13 |
# File 'lib/codebreaker/secret_code_matcher.rb', line 11 def call exact_match + digit_match end |