module Hashie::Extensions::Mash::KeepOriginalKeys
def self.included(descendant)
def self.included(descendant) unless descendant <= Hashie::Mash fail ArgumentError, "#{descendant} is not a kind of Hashie::Mash" end end
def __convert(key)
-
(Object, String, Symbol)
- the converted key.
Parameters:
-
key
(Object, String, Symbol
) -- the key to convert.
def __convert(key) case key when Symbol then key.to_s when String then key.to_sym else key end end
def convert_key(key)
-
(Object)
- the value assigned to the key.
Parameters:
-
key
(Object, String, Symbol
) -- the key to access.
def convert_key(key) if regular_key?(key) key elsif (converted_key = __convert(key)) && regular_key?(converted_key) converted_key else key end end