Parent

Methods

Array

Public Instance Methods

to_hash() click to toggle source

Transforms an Array of key/value pairs into a Hash

This is a better idiom than using Hash in Ruby 1.8.6 because it is not possible to limit the flattening to a single level.

@return [Hash]

  A Hash where each entry in the Array is turned into a key/value

@api public

    # File lib/extlib/array.rb, line 16
16:   def to_hash
17:     h = {}
18:     each { |k,v| h[k] = v }
19:     h
20:   end
to_mash() click to toggle source

Transforms an Array of key/value pairs into a Mash

This is a better idiom than using Mash in Ruby 1.8.6 because it is not possible to limit the flattening to a single level.

@return [Mash]

  A Hash where each entry in the Array is turned into a key/value

@api public

    # File lib/extlib/array.rb, line 33
33:   def to_mash
34:     m = Mash.new
35:     each { |k,v| m[k] = v }
36:     m
37:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.