前言
本周是一篇关于Ruby的文章,虽然没接触过,权当多样性的点缀了。...It’s Proc#call....a_proc = Proc.new {|scalar, *values| values.map {|value| value*scalar } } a_proc.call(9, 1, 2, 3)...#=> [9, 18, 27] a_proc[9, 1, 2, 3] #=> [9, 18, 27] a_proc.(9, 1, 2, 3) #=> [9, 18, 27]...So let’s make our service object behave more like a proc!