lib/quickbooks/ruby_magic.rb
# Transform all the keys in the hash to CamelCase format.
Transform all the keys in the hash to CamelCase format.
Transform all the keys in the hash to CamelCase format .
def transform_keys!(trans_hash,&block)
    raise ArgumentError, "transform_keys takes a single hash argument or a block" unless trans_hash.is_a?(Hash) || block_given?
    if block_given?
      each do |k,v|
        block.call(h,k,v)
      end
    else
      trans_hash.each do |k,v|
        self[v] = self.delete(k) if self.has_key?(k)
      end
    end
    self
  end
def transform_keys! ( trans_hash , & block ) raise ArgumentError , "transform_keys takes a single hash argument or a block" unless trans_hash . is_a? ( Hash ) || block_given? if block_given? each do | k , v | block . call ( h , k , v ) end else trans_hash . each do | k , v | self [ v ] = self . delete ( k ) if self . has_key? ( k ) end end self end
Transform all the keys in the hash to CamelCase format.
Transform all the keys in the hash to CamelCase format .
trans_hash
<not_specific>
block
<not_specific>