Skip to content

Instantly share code, notes, and snippets.

@shamritskiy3468
Created December 16, 2018 21:21
Show Gist options
  • Save shamritskiy3468/50e0f3fe22f003224f4d30e7b0f5b3f4 to your computer and use it in GitHub Desktop.
Save shamritskiy3468/50e0f3fe22f003224f4d30e7b0f5b3f4 to your computer and use it in GitHub Desktop.
Task7
array_of_words = ["Words", "Sobaka", "Paralelogram", "Polundrom", "Yes", "No"]
puts array_of_words.sort_by { |word| word.length}
@aya-soft
Copy link

А как короче это записать? sort_by { |word| word.length}

@shamritskiy3468
Copy link
Author

shamritskiy3468 commented Dec 22, 2018

sort_by(&:length)
???

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