Safe Constantize

A library that behaves like- and utilizes String#constantize but implements a layer of security.

Read about the security problems here:

blog.littleimpact.de/index.php/2008/08/13/constantize-with-care/

Install

Add to your Gemfile and bundle:

gem "safe_constantize"

Usage

SafeConstantize.constantize("File", ["File"]) #=> File
SafeConstantize.constantize("File", ["String"]) #=> Error: SafeConstantize::IllegalClassToConstantize

Contributing to safe_constantize

Copyright © 2015 kaspernj. See LICENSE.txt for further details.