Project

General

Profile

Feature #12319

Updated by sawa (Tsuyoshi Sawada) almost 5 years ago

`Module#const_get` accepts non-nested string, nested string, and non-nested symbol: 

 ~~~ruby 
 class A; class B; class C end end end 

 A.const_get("B")      # => A::B 
 A.const_get("B::C") # => A::B::C 
 A.const_get(:B)       # => A::B 
 ~~~ 

 but does not accept nested symbol: 

 ~~~ruby 
 A.const_get(:"B::C") # => NameError: wrong constant name B::C 
 ~~~ 

 I would like this to be made possible.

Back