Class: CompareFiles::Base
- Inherits:
-
Object
- Object
- CompareFiles::Base
- Defined in:
- lib/compare_files.rb
Instance Method Summary collapse
- #compare ⇒ Object
-
#initialize(file1, file2) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(file1, file2) ⇒ Base
Returns a new instance of Base.
7 8 9 10 |
# File 'lib/compare_files.rb', line 7 def initialize(file1, file2) @file1array = array_from_file_lines(file1) @file2array = array_from_file_lines(file2) end |
Instance Method Details
#compare ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/compare_files.rb', line 12 def compare @result_array = [] (0...max_arrays_length).each do |i| make_result_array(@file1array[i], @file2array[i]) end print_result end |