Sha256: 76ac1dd3de44ac53bbd6153c5abe0fd0414cb573395a93004bbfffbd2b1e472b
Contents?: true
Size: 351 Bytes
Versions: 2
Compression:
Stored size: 351 Bytes
Contents
require 'array/hash_builder' class Array def chain_map(*methods) result = self result = result.map(&(methods.shift)) until methods.empty? return result unless block_given? result.map { |*args| yield(*args) } end def as_hash(keys) Array::HashBuilder.new(self, keys).build end def random self[rand(size)] end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bidu-core_ext-1.2.1 | lib/array.rb |
bidu-core_ext-1.2.0 | lib/array.rb |