fork download
  1.  
  2. class A
  3. def self.new(*, &block)
  4. a = super
  5. a.send(:foo=, "hello")
  6. a
  7. end
  8.  
  9. attr_accessor :foo
  10. private :foo=
  11. end
  12.  
  13. a = A.new
  14. p a.foo
  15. a.foo = "Hi"
Runtime error #stdin #stdout 0s 4760KB
stdin
Standard input is empty
stdout
"hello"