fork download
  1. class Foo
  2. def self.test
  3. p :test
  4. end
  5. end
  6.  
  7. a = []
  8.  
  9. Foo.define_singleton_method(:test){ a << :foo }
  10. Foo.test
  11. Foo.test
  12.  
  13. p a
Success #stdin #stdout 0s 4716KB
stdin
Standard input is empty
stdout
[:foo, :foo]