Sha256: f90ec8d497afb2f277fe0fa981355194cba2ab0eae6006f1afc4b2247531a789

Contents?: true

Size: 293 Bytes

Versions: 17

Compression:

Stored size: 293 Bytes

Contents

class Array

  #--
  # Taken from http://snippets.dzone.com/posts/show/302
  #
  # >> %W{ a b c }.to_hash_with( %W{ 1 2 3 } )
  # => {"a"=>"1", "b"=>"2", "c"=>"3"}
  #++
  def to_hash_with(other)
    Hash[ *(0...self.size()).inject([]) { |arr, ix| arr.push(self[ix], other[ix]) } ]
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
typus-3.0.4 lib/support/array.rb
typus-3.0.2 lib/support/array.rb
typus-3.0.1 lib/support/array.rb
typus-3.0.0 lib/support/array.rb
typus-1.0.0.pre13 lib/support/array.rb
typus-1.0.0.pre12 lib/support/array.rb
typus-1.0.0.pre11 lib/support/array.rb
typus-1.0.0.pre10 lib/support/array.rb
typus-1.0.0.pre9 lib/support/array.rb
typus-1.0.0.pre8 lib/support/array.rb
typus-1.0.0.pre7 lib/support/array.rb
typus-1.0.0.pre6 lib/support/array.rb
typus-1.0.0.pre5 lib/support/array.rb
typus-1.0.0.pre4 lib/support/array.rb
typus-1.0.0.pre3 lib/support/array.rb
typus-1.0.0.pre2 lib/support/array.rb
typus-1.0.0.pre lib/support/array.rb