I apologize if this is a foolish questions, but I am new to the language 
and having trouble finding an example of what I am looking to do (if 
it's possible.)

I would like to know if there is a way to pass in the name of the 
iterator to use from a variable or similar.  I am looking to do 
something like:

        params[:user].each_key do |attr|
          user.attr = params[:user][attr]
        end

For now I can just use a giant case statement like this:

        params[:user].each_key do |attr|
          case attr
            when "givenName"
              user.givenName = params[:user][attr]
            when "sn"
              user.sn = params[:user][attr]
            when "mail"
              user.mail = params[:user][attr]
            when "o"
              user.o = params[:user][attr]
          end
        end

But it would be nice to know if there is a cleaner way to handle this.

-- 
Posted via http://www.ruby-forum.com/.