# used for encrypting and decrypting data in forms module Lux class Current module EncryptParams extend self # encrypt_param('dux', 'foo') # ] end # decrypts params starting with _data_ def decrypt hash for key in hash.keys next unless key.starts_with?('_data_') data = Crypt.decrypt(hash.delete(key)) data, value = data.split('#', 2) data = data.split('::') if data[1] hash[data[0]] ||= {} hash[data[0]][data[1]] = value else hash[data[0]] = value end end hash rescue Lux.log ' Lux::Current::EncryptParams decrypt error'.red {} end end end end