Skip to content

Latest commit

 

History

History
28 lines (15 loc) · 858 Bytes

core-extensions.textile

File metadata and controls

28 lines (15 loc) · 858 Bytes

Extensions to Existing Ruby Classes

These extensions are loaded early in the application startup and are located here: config/initializers/00_core_extensions.rb

Core Ruby Classes

Hash

Hash is extended with a method: recursive_symbolize_keys which Recursively converts the keys in a Hash to symbols.
It also converts the keys in any Array elements which are Hashes to symbols.

Kernel

Kernel is extended with the method: suppress_warnings

This enables selective supression of warnings from Ruby such as when redefining
the constant: REST_AUTH_SITE_KEY when running spec tests

See: http://mentalized.net/journal/2010/04/02/suppress_warnings_from_ruby/

String

String is extended with the methods: underscore_module, delete_module(num=1)

Rails

ActionView::Helpers::CaptureHelper is extended with the method: set_content_for