Displaying 2 results from an estimated 2 matches for "tmparray".
Did you mean:
tmp_array
2006 Mar 16
3
Passing function names from string variables
...y be a more generic Ruby question, so I''m going to ask on the Ruby
forum, but I''m trying to figure out if there is a way to pass in the string
value of a variable as the name of a method.
For example, I would like to do something like:
def sort_obj_by_uid(objects,@attr)
@tmparray = Array.new
@tmphash = Hash.new
for object in @objects
if ! @tmphash.has_key?(object.@attr.to_s)
@tmphash[object.@attr.to_s] = Array.new
end
@tmphash[object.@attr.to_s].push(object)
end
end
Where the method name is the @attr value.
--
Leah Cunningham : d41...
2009 Feb 26
11
OpenSSL::Cipher decrypt returns 'wrong final block length'
I just want to encrypt a string submitted through a form before saving
it to the DB. And then decrypt it again when I need to retrieve and
use it.
Im trying to use the OpenSSL::Cipher library. I have the following
module for encryption/decryption
[code]
require ''openssl''
module AESCrypt
# Decrypts a block of data (encrypted_data) given an encryption key
# and an