2017-12-30から1日間の記事一覧
書いて見た。jbuilderっぽい見た目になった。 class Object def call(*methods) methods.map do |method| self.send(method) end end end p [1,2,3].(:first, :last, :class) # => [1, 3, Array]
書いて見た。jbuilderっぽい見た目になった。 class Object def call(*methods) methods.map do |method| self.send(method) end end end p [1,2,3].(:first, :last, :class) # => [1, 3, Array]