Project

cymbal

0.0
No release in over 3 years
Low commit activity in last 3 years
Allows saner hash key manipulation by converting keys to symbols
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.1.1
~> 2.3.0
~> 0.6.0
~> 12.3.0
~> 3.8.0
~> 0.59.0
 Project Readme

cymbal

Gem Version GitHub Workflow Status MIT Licensed

Convert Ruby hash keys from strings to symbols for easier manipulation

Usage

require 'cymbal'
x = {
    'foo' => 1,
    'bar' => {
        'cats' => 6,
        'dogs' => 'better'
    }
}
Cymbal.symbolize(x) # returns {:foo=>1, :bar=>{:cats=>6, :dogs=>"better"}}

The symbolize call will convert keys recursively and will handle an array of hashes.

If a hash includes keys that would collide (for example, :foo and 'foo'), an ArgumentError will be raised.

Installation

gem install cymbal

License

cymbal is released under the MIT License. See the bundled LICENSE file for details.