Sha256: ae54a8595fbe699a6e6d6de7afe2a0bfd57473283c64f0baab758d16cd1b9c8f

Contents?: true

Size: 292 Bytes

Versions: 10

Compression:

Stored size: 292 Bytes

Contents

class Hash
  def Hash.with_keys_values(keys, values)
    raise ArgumentError, "Unmatching sizes #{keys.size} != #{values.size}" unless keys.size == values.size
    #Hash[keys.zip(values).flatten]
    ret = Hash.new
    keys.each_with_index{|key, idx| ret[key] = values[idx]}
    ret
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
jactive_support-2.1.2 lib/jactive_support/core_ext/hash/with_keys_values.rb
jactive_support-3.0.0 lib/jactive_support/core_ext/hash/with_keys_values.rb
jactive_support-3.0.0.pre2 lib/jactive_support/core_ext/hash/with_keys_values.rb
jactive_support-3.0.0.pre1 lib/jactive_support/core_ext/hash/with_keys_values.rb
jactive_support-2.1.1 lib/jactive_support/core_ext/hash/with_keys_values.rb
jactive_support-2.1.0 lib/jactive_support/core_ext/hash/with_keys_values.rb
jactive_support-2.0.0 lib/jactive_support/core_ext/hash/with_keys_values.rb
jactive_support-1.0.2 lib/jactive_support/core_ext/hash/with_keys_values.rb
jactive_support-1.0.1-universal-java-1.6 lib/jactive_support/core_ext/hash/with_keys_values.rb
jactive_support-1.0.0-universal-java-1.6 lib/jactive_support/core_ext/hash/with_keys_values.rb