Sha256: 4f7edc38a4af6ab6197646c07ca61be6fe1f4bb8a6578d8688bac35fcb73c1ba

Contents?: true

Size: 249 Bytes

Versions: 5

Compression:

Stored size: 249 Bytes

Contents

module Enumerable
  # %w{A C G T}.collect_hash{|k| [k*2, k*3] }
  # # ==> {"AA" => "AAA", "CC" => "CCC", "GG" => "GGG", "TT" => "TTT"}
  def collect_hash(&block)
    block_given?  ?  Hash[ collect(&block) ]  :  Hash[ collect{|k,v| [k,v]} ]
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bioinform-0.1.17 lib/bioinform/support/collect_hash.rb
bioinform-0.1.16 lib/bioinform/support/collect_hash.rb
bioinform-0.1.15 lib/bioinform/support/collect_hash.rb
bioinform-0.1.14 lib/bioinform/support/collect_hash.rb
bioinform-0.1.13 lib/bioinform/support/collect_hash.rb