Class: Codebreaker::Codechecker
- Inherits:
-
Object
- Object
- Codebreaker::Codechecker
- Defined in:
- lib/codebreaker/codechecker.rb
Instance Attribute Summary collapse
-
#guess_array ⇒ Object
readonly
Returns the value of attribute guess_array.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#secret_code_array ⇒ Object
readonly
Returns the value of attribute secret_code_array.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(guess_array, secret_code_array) ⇒ Codechecker
constructor
A new instance of Codechecker.
Constructor Details
#initialize(guess_array, secret_code_array) ⇒ Codechecker
Returns a new instance of Codechecker.
7 8 9 10 11 |
# File 'lib/codebreaker/codechecker.rb', line 7 def initialize(guess_array, secret_code_array) @guess_array = guess_array @secret_code_array = secret_code_array @response = { in_plase: 0, out_of_place: 0 } end |
Instance Attribute Details
#guess_array ⇒ Object (readonly)
Returns the value of attribute guess_array.
5 6 7 |
# File 'lib/codebreaker/codechecker.rb', line 5 def guess_array @guess_array end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/codebreaker/codechecker.rb', line 5 def response @response end |
#secret_code_array ⇒ Object (readonly)
Returns the value of attribute secret_code_array.
5 6 7 |
# File 'lib/codebreaker/codechecker.rb', line 5 def secret_code_array @secret_code_array end |
Instance Method Details
#call ⇒ Object
13 14 15 16 |
# File 'lib/codebreaker/codechecker.rb', line 13 def call in_plase_check out_of_place_check end |