Sha256: e33434762005bcedbc75c9964b3c1e55bff87c7467db0c8aa988d46d49ff2244

Contents?: true

Size: 201 Bytes

Versions: 1

Compression:

Stored size: 201 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

1 entries across 1 versions & 1 rubygems

Version Path
caricature-0.7.7 lib/caricature/core_ext/array.rb