December 2009
3 posts
2 tags
tap method in Ruby 1.9
str = "Hello GG" str.tap {|x| puts "str : #{x}"} .each_char.tap {|x| puts "each_char : #{x}"} .sort.tap {|x| puts "sort : #{x}"} Output str : Hello GG each_char : # sort : [" ", "G", "G", "H", "e", "l", "l", "o"]
Dec 31st
Dec 30th
Dec 30th