Advertisement
saasbook

method_chaining.rb

Jan 10th, 2012
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.16 KB | None | 0 0
  1. # downcase and split are defined in String class
  2. words = IO.read("file").
  3.   split(/\W+/).
  4.   select { |s| s =~ /^[aeiou]/i }.
  5.   map { |s| s.downcase }.
  6.   uniq.
  7.   sort
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement