title: Ruby alternative to .each() working with one item
body: <p>I am getting tired of using if loops because the <code>.each</code> function is not working when applied to one object.</p>
  
  <p>For example :</p>
  
  <pre><code>@groups = ...
  users = User.find(params[:selected_users])
  
  if params[:selected_users].count == 1  # case with one object
    users.some_method()
  else                          # case with multiple objects
    users.each do |user|
      user.some_method()
    end
  end
  </code></pre>
  
  <p>Is there a function that would do the same as <code>.each</code> and that would simply return the object when applied to one object ?</p>