Lee
2006-Nov-06 21:27 UTC
@params[''user''].delete(''form'') - what does .delete(''form'') do?
Trying to understand the SaltedHashLoginGenerator and came across this. What does the .delete(''form'') do? Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2006-Nov-06 21:51 UTC
Re: @params[''user''].delete(''form'') - what does .delete(''form'') do?
> Trying to understand the SaltedHashLoginGenerator and came across this. > What does the .delete(''form'') do?http://corelib.rubyonrails.org/classes/Hash.html#M000710 Deletes and returns a key-value pair from hsh whose key is equal to key. If the key is not found, returns the default value. If the optional code block is given and the key is not found, pass in the key and return the result of block. h = { "a" => 100, "b" => 200 } h.delete("a") #=> 100 h.delete("z") #=> nil h.delete("z") { |el| "#{el} not found" } #=> "z not found" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---