Class: AlexCodebreaker::Comparison

Inherits:
Object
  • Object
show all
Defined in:
lib/alex_codebreaker/comparison.rb

Instance Method Summary collapse

Constructor Details

#initialize(user_input, secret_code_for_comparison) ⇒ Comparison

Returns a new instance of Comparison.



3
4
5
6
7
# File 'lib/alex_codebreaker/comparison.rb', line 3

def initialize(user_input, secret_code_for_comparison)
  @user_input = user_input
  @secret_code_for_comparison = secret_code_for_comparison
  @matching = { place: 0, presence: 0 }
end

Instance Method Details

#responseObject



9
10
11
12
13
# File 'lib/alex_codebreaker/comparison.rb', line 9

def response
  place_matches
  presence_matches
  format_response
end