Issue #11919 has been reported by Tsuyoshi Sawada.

----------------------------------------
Feature #11919: Passing a module directly 
https://bugs.ruby-lang.org/issues/11919

* Author: Tsuyoshi Sawada
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Refinement requires a named module:

    module MyRefinement
      refine ...
      ...
    end

    using MyRefinement

but often (but not always), refinements are called by the `using` command only in once in a single file, and should not need to be named in such case. Also, the purpose of refinement is to not pollute classes with methods. Necessity to define a module and polluting the name space looks to me to go against this idea.

I would like to do:


    using Module.new do
      refine ...
      ...
    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>