0.0
No commit activity in last 3 years
No release in over 3 years
This gem convert from String which follow Hash format to collectively HashClass. You can revert string which was converted by 'to_s' method.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0
>= 0
 Project Readme

Build Status

str_to_hash

This gem convert from String which follow Hash format to collectively HashClass.
You can revert string which was converted by 'to_s' method.

How to Install

gem install str_to_hash

Usage

You can convert by 'to_h' method.

hash = {'foo'=>'bar', 'fizz'=>'bazz'}
str = hash.to_s


str => "{\"foo\"=>\"bar\", \"fizz\"=>\"bazz\"}"
str.class => String
str.size => 30

str.to_h => {"foo"=>"bar", "fizz"=>"bazz"}
str.to_h.class => Hash
str.to_h.size => 2

Contributing

If you would like to contribute, please...

  1. Fork.
  2. Make changes in a branch & add unit tests.
  3. Run Unit Test
$ rspec spec/str_to_hash_spec.rb
  1. Create a pull request.

Contributions, improvements, comments and suggestions are welcome!

License

The gem is available as open source under the terms of the MIT License.