Project

General

Profile

Bug #4537

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

``` 
 # The following fails with a failure to call "`x=`" "x=" private method 

 ```ruby 
 String.send(:attr_accessor, :x) 
 s = "" 
 s.x = 100 
 ``` 

 # The following works: 

 ```ruby 
 class String 
   self.send(:attr_accessor, :x) 
 end 
 s = "" 
 s.x = 100 
 ``` 

Back