class Foo def self.test p :test endend a = [] Foo.define_singleton_method(:test){ a << :foo }Foo.testFoo.test p a
Standard input is empty
[:foo, :foo]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!