Issue #8563 has been updated by Rodrigo Rosenfeld Rosas.


Also it doesn't handle variable arguments, extra options that shouldn't be assigned to instance variables or &block.

----------------------------------------
Feature #8563: Instance variable arguments
https://bugs.ruby-lang.org/issues/8563#change-59694

* Author: Tsuyoshi Sawada
* Status: Assigned
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
Often times, people want to assign given arguments to instance variables, especially inside the method `initialize`:

~~~Ruby 
def initialize foo, bar, buz
  @foo, @bar, @buz = foo, bar, buz
  ...
end
~~~

I propose to let method definition take instance variables as arguments so that:

~~~Ruby 
def initialize @foo, @bar, @buz
  ...
end
~~~

would be equivalent as above.




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>