find
 
  find(p1 = v1)
  public
  Passes each entry in enum to block. Returns the first for which block is not false. If no object matches, calls ifnone and returns its result when it is specified, or returns nil otherwise.
If no block is given, an enumerator is returned instead.
(1..10).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> nil (1..100).find { |i| i % 5 == 0 and i % 7 == 0 } #=> 35
 tadman -  
    April  1, 2009
 tadman -  
    April  1, 2009 
    
  Returns the element, not block result
Enumerable#find will always return the element that is found, not the result of the block provided.
 MattStopa -  
    March 11, 2012
 MattStopa -  
    March 11, 2012 
    
   rubynooby -  
    February 12, 2015
 rubynooby -  
    February 12, 2015 
    
  Example is a Bug!
Why is the example showing the use of the #detect method and not #find? Boggles the mind!
 shimrra -  
    November 17, 2015
 shimrra -  
    November 17, 2015 
    
  Find and Detech are the same
@rubynooby: #find and #detect are aliases of the same underlying method. You can use them interchangeably to provide additional readability to your code (find an element to use it or detect if an element is present to do something).
http://ruby-doc.org/core-2.2.3/Enumerable.html#method-i-find

 RSpec
RSpec Ruby on Rails
Ruby on Rails Ruby
Ruby 
   
   
   
   
   
   = private
 = private = protected
 = protected
   
    