Issue #7019 has been updated by kou (Kouhei Sutou).

Status changed from Assigned to Rejected

#3753 adds `private def ...` support. If you still want this feature, please reopen this issue.

----------------------------------------
Feature #7019: allow `private` and `protected` keywords to take blocks
https://bugs.ruby-lang.org/issues/7019#change-69672

* Author: alexeymuranov (Alexey Muranov)
* Status: Rejected
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: Next Major
----------------------------------------
I like to indent my private methods one level deeper, but this indentation is inconsistent with the syntax:

~~~ruby
class C
  def f
    #
  end
  private
    def g
    #
    end
end
~~~

I think it would be nice if the `private` keyword could take a block, then i would write:

~~~ruby
class C
  def f
    #
  end
  private do
    def g
    #
    end
  end
end
~~~




-- 
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>