Created
November 23, 2018 22:23
-
-
Save VladHurma/d7a9d3494a5a008a2c8aadce7155f0d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sort_array | |
def initialize | |
@numbers = [0, 4, 2, 6, 1, 9, 5, 8, 3, 7] | |
end | |
def self.run | |
new.run | |
end | |
def run | |
show_user_array_before_changes | |
sort_numbers | |
show_user_sorted_array | |
end | |
private | |
def sort_numbers | |
@numbers.sort! | |
end | |
def show_user_array_before_changes | |
print "#{@numbers}\n" | |
end | |
def show_user_sorted_array | |
print "#{@numbers}\n" | |
end | |
end | |
Sort_array.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🥇