Project

General

Profile

Feature #4910

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

I suggest to add these two to class `Class`: Class: 

 ```ruby 
 class Class 
   alias call new 

   def to_proc(*args) 
     lambda {|*a| new(*args)} 
   end 
 end 
 ``` 

 Then we can use class instances where blocks are needed and can easily use them as factory instances using the general contract of `#call` #call (see example attached).

Back