Issue #7019 has been updated by shyouhei (Shyouhei Urabe).


I know you like blocks but this proposal doesn't make sense to me because public/private/protected are declarations, not something done.   So it's odd to say "private DO something".  I'd rather +1 to private def, which is natural (to me at least).
----------------------------------------
Feature #7019: allow `private` and `protected` keywords to take blocks
https://bugs.ruby-lang.org/issues/7019#change-29443

Author: alexeymuranov (Alexey Muranov)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 


=begin
I like to indent my private methods one level deeper, but this indentation is inconsistent with the syntax:

 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:

 class C
   def f
     #
   end
   private do
     def g
     #
     end
   end 
 end
=end



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