Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Convert nested hash to a flattened 2D key-value hash
Ruby
tree: d13a31a04a
Failed to load latest commit information.
lib Initial commit
test
.gitignore remove Gemfile.lock, rename gemspec to gem name
CHANGELOG.md Initial commit
Gemfile Initial commit
LICENSE
README.md Installation instructions in README
Rakefile
to_2d_hash.gemspec

README.md

to_2d_hash

Convert an existing Hash to a two-dimensional Hash with concatenated keys:

h = {'a' => 'b', 'c' => {'d' => 'e'}}
h.to_2d_hash
# gives {'a' => 'b', 'c_d' => 'e'}

Installation

$ gem install to_2d_hash

And then include in you project with Bundler or require 'to_2d_hash'. This will add a to_2d_hash instance method to all Ruby hash objects.

Options

  • :delimiter : glue string to use for key concatenation. Defaults to '_'

Copyright (c) 2012 Floris Huetink

Something went wrong with that request. Please try again.