Sha256: 55f219dd8dbd4759dcca3f8f625101c100bd01dde33fb9da5ae116f66ff952cb

Contents?: true

Size: 351 Bytes

Versions: 2

Compression:

Stored size: 351 Bytes

Contents

class Hash
  def stringify_keys
    result = self.class.new
    orig_key_len = keys.length()
    each_key do |key|
      result[key.to_s] = self[key]
    end
    unless result.keys.length() == orig_key_len
        raise "Duplicate key name during convertion, there might be symbol & string key with the same name."
    end
    return result
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
ecpay_payment-1.1.2 lib/ecpay_payment/core_ext/hash.rb
ecpay_invoice-0.1.0 lib/ecpay_invoice/core_ext/hash.rb