Module: Hashie::Extensions::Mash::KeepOriginalKeys

Defined in:
lib/hashie/extensions/mash/keep_original_keys.rb

Overview

Overrides the indifferent access of a Mash to keep keys in the original format given to the Mash.

Examples:

class KeepingMash < Hashie::Mash
  include Hashie::Extensions::Mash::KeepOriginalKeys
end

mash = KeepingMash.new(:symbol_key => :symbol, 'string_key' => 'string')
mash.to_hash  #=> { :symbol_key => :symbol, 'string_key' => 'string' }
mash['string_key'] == mash[:string_key]  #=> true
mash[:symbol_key] == mash['symbol_key']  #=> true