Sha256: 8485b1082b9ceca0eaf801e436a697669a08bdf0dead1a221ada2407d9d3b3a0

Contents?: true

Size: 310 Bytes

Versions: 2

Compression:

Stored size: 310 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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bidu-core_ext-1.1.1 lib/array.rb
bidu-core_ext-1.0.0 lib/array.rb