title: Is there a shorthand version of this loop in Ruby
body: <p>I am writing a code that has lines limit of a method so I am trying to write the shortest possible version of this loop :</p>
  
  <pre><code>for i in (0..number)
    #lines of code
  end
  </code></pre>
  
  <p>I was wondering if there is a way to do it somehow similar to:</p>
  
  <pre><code>{
    #lines of code
  }*number
  </code></pre>
  
  <p>In general I am looking for the shortest possible way of writing something like this.</p>