Sha256: 5732d904e82f8d14ad4800f74b08a8f392b720f9ca819dd99e044464156ff742
Contents?: true
Size: 311 Bytes
Versions: 12
Compression:
Stored size: 311 Bytes
Contents
#-- # Credit goes to Sean O'Halpin (ruby-talk:199877). #++ module Enumerable # Cascade actions on each enumerated element. # # [9, 19, 29].cascade :succ, :to_s, :reverse # => ["01", "02", "03"] def cascade(*methods) methods.inject(self) { |ary, method| ary.map{ |x| x.send(method)}} end end
Version data entries
12 entries across 12 versions & 1 rubygems