Sha256: fdb2f5a4ed441ee88868a964c4e08d6daf95b3e63fae6946427865502617b29f

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

Hash Mapper
===========

Ruby DSL for parsing hashes.

Installation
------------

hash_mapper is hosted on gemcutter.

If you are using bundle (and you should):

    gem 'hash_mapper'

Run `bundle` and start hacking.

Usage
-----

Simple example:

    require "hash_converter"
    hash = {
      :person => {
        :first_name => "Jonh",
        :last_name => "Doe",
        :address => {
          :street => "Hoża",
          :city => "Warsaw",
          :zip => "12345"
        }
      }
    }

    hash_converted = HashConverter.convert(hash) do
      path "person" do
        map "{first_name} {last_name}", "name"
        path "address" do
          map "{street} {city} {zip}", "address"
        end
      end
    end

    pp hash_converted

For more features, checkout tests. There are cool things like: #get, #set methods etc.

Contributing
------------

* Fork the project.
* Create branch for your changes
* Write tests
* Write change / fix
* Commit
* Pull request

Author
-------

- Łukasz Strzałkowski (<http://github.com/strzalek>)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hash_converter-0.0.2 README.md