Class: Codebreaker::Codechecker

Inherits:
Object
  • Object
show all
Defined in:
lib/codebreaker/codechecker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_arrayObject (readonly)

Returns the value of attribute guess_array.



5
6
7
# File 'lib/codebreaker/codechecker.rb', line 5

def guess_array
  @guess_array
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/codebreaker/codechecker.rb', line 5

def response
  @response
end

#secret_code_arrayObject (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

#callObject



13
14
15
16
# File 'lib/codebreaker/codechecker.rb', line 13

def call
  in_plase_check
  out_of_place_check
end