Socket
Book a DemoInstallSign in
Socket

hash-normalizekeys

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-normalizekeys

1.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

StringKeys

A StringKeys object works like a hash, except keys which are not strings are converted to strings.

require 'stringkeys'
sk = StringKeys.new
sk[:name] = 'Fred'
sk.keys[0].class #=> String

The idea is simple. When a key comes in, whether for [] or []=, if it is not a string, then its .to_s method is called and the result is used for the key. So the following lines produce identical results:

sk[MyClass] = 1
sk[:MyClass] = 1
sk['MyClass'] = 1

Installation

gem install stringkeys

Author

Mike O'Sullivan mike@idocs.com

History

versiondatenotes
1.0Mar 1, 2020Initial upload.

FAQs

Package last updated on 02 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.