Ruby: shorter way to define instance variables
<p>I'm looking for the shorter way to define instance variables inside the <code>initialize</code> method:</p>

<pre><code>class MyClass
  attr_accessor :foo, :bar, :baz, :qux
  # Typing same stuff all the time is boring
  def initialize(foo, bar, baz, qux)
    @foo, @bar, @baz, @qux = foo, bar, baz, qux
  end
end
</code></pre>

<p>Does Ruby have any in-build feature which lets to avoid this kind of monkey job?</p>

<pre><code># e. g.
class MyClass
  attr_accessor :foo, :bar, :baz, :qux
  # Typing same stuff all the time is boring
  def initialize(foo, bar, baz, qux)
    # Leveraging built-in language feature
    # instance variables are defined automatically
  end
end
</code></pre>