module Enumerable def chain(obj) self.inject(obj) { |obj, method| obj.send(*method) } endendp [:upcase, [:<<, ", world!"], [:split, //]].chain("hello")p ("hello".upcase<<", world!").split(//)
Post a Comment
No comments:
Post a Comment