Sha256: 9427e5d9798b212c1866f00a30ee0a1f36af62265834370da206b57e51be4272

Contents?: true

Size: 210 Bytes

Versions: 12

Compression:

Stored size: 210 Bytes

Contents

class Array

  # Converts an array of values to a hash.
  # the even indexes are the hash keys
  # the odd indexes are the hash values
  def to_h
    h = Hash[*self]
    h.symbolize_keys!    
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
casualjim-caricature-0.5.0 lib/core_ext/array.rb
casualjim-caricature-0.6.0 lib/core_ext/array.rb
casualjim-caricature-0.6.1 lib/core_ext/array.rb
caricature-0.7.6 lib/caricature/core_ext/array.rb
caricature-0.7.5 lib/caricature/core_ext/array.rb
caricature-0.7.2 lib/core_ext/array.rb
caricature-0.7.1 lib/core_ext/array.rb
caricature-0.7.0 lib/core_ext/array.rb
caricature-0.6.3 lib/core_ext/array.rb
caricature-0.6.0 lib/core_ext/array.rb
caricature-0.5.0 lib/core_ext/array.rb
caricature-0.6.1 lib/core_ext/array.rb