title: Ruby: Dynamically creating function call arguments list from an array
body: <p>I'm creating a spreadsheet using the <code>axlsx</code> gem. I'd like to set fixed width to on all spreadsheet columns and I need to call the function</p>
  
  <pre><code>def column_widths(*widths)
    widths.each_with_index do |value, index|
      next if value == nil
      Axlsx::validate_unsigned_numeric(value) unless value == nil
      find_or_create_column_info(index).width = value
    end
  end
  </code></pre>
  
  <p>defined in the <code>Axlsx::Worksheet</code> with an arbitrary number of column widths. E.g. `sheet.column_width(20, 20, ..., 20). My method call looks like</p>
  
  <pre><code>sheet.column_widths [20]*headers.length
  </code></pre>
  
  <p>and it result in the error</p>
  
  <pre class="lang-none prettyprint-override"><code>ActionView::Template::Error (Invalid Data [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20] for Invalid column width. must be [Fixnum, Integer, Float].
  </code></pre>
  
  <p>How can I dynamically create a proper method call for the unknown number of columns?</p>