Skip to content

Instantly share code, notes, and snippets.

@VladHurma
Created November 23, 2018 22:23
Show Gist options
  • Save VladHurma/d7a9d3494a5a008a2c8aadce7155f0d4 to your computer and use it in GitHub Desktop.
Save VladHurma/d7a9d3494a5a008a2c8aadce7155f0d4 to your computer and use it in GitHub Desktop.
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
@aya-soft
Copy link

🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment